/* Maps Page Specific Styles */

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #000 0%, #2a2a2a 100%);
    color: #FFD700;
    padding: 70px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 20px;
    color: #FFF;
}

/* Content Container */
.content-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Map Section */
.map-section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 36px;
    color: #FFD700;
    margin-bottom: 10px;
    text-align: center;
}

.section-description {
    font-size: 18px;
    color: #CCC;
    text-align: center;
    margin-bottom: 20px;
}

/* Maps Grid */
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Map Card */
.map-card {
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.map-card:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.2);
}

.map-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.map-card:hover .map-image img {
    transform: scale(1.05);
}

.map-content {
    padding: 20px;
    flex: 1;
}

.map-title {
    color: #FFD700;
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: bold;
}

.map-year {
    color: #c0c0c0;
    font-size: 18px;
    font-style: italic;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    touch-action: none;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
}

body.lightbox-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #FFD700;
}

.lightbox-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lightbox-title {
    color: #FFD700;
    font-size: 28px;
    font-weight: bold;
}

.lightbox-year {
    color: #c0c0c0;
    font-size: 18px;
    font-style: italic;
}

.close-btn {
    background: none;
    border: 2px solid #FFD700;
    color: #FFD700;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    background-color: #FFD700;
    color: #000;
    transform: scale(1.1);
}

.map-viewer-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    overflow: hidden;
    background-color: #000;
    cursor: default;
    flex: 1;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    -webkit-overflow-scrolling: auto;
}

.map-viewer-image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    transform-origin: center center;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.viewer-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(0, 0, 0, 0.95);
    padding: 15px 20px;
    border-radius: 30px;
    border: 2px solid #FFD700;
    z-index: 10000;
    pointer-events: all;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.control-btn {
    background-color: #FFD700;
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 26px;
    font-weight: 900;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.control-btn:hover {
    background-color: #FFF;
    transform: scale(1.1);
}

.zoom-level {
    color: #FFD700;
    font-size: 18px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .maps-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 38px;
    }

    .viewer-controls {
        bottom: 15px;
        gap: 10px;
        padding: 12px 18px;
        border-radius: 28px;
    }

    .lightbox-header {
        padding: 12px 15px;
    }

    .lightbox-title-wrapper {
        flex: 1;
        min-width: 0;
        margin-right: 10px;
    }

    .lightbox-title {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lightbox-year {
        font-size: 14px;
    }

    .close-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 24px;
        flex-shrink: 0;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .zoom-level {
        font-size: 16px;
        padding: 0 8px;
        min-width: 50px;
    }
}

/* Loading Message */
.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #FFD700;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px 40px;
    border-radius: 8px;
    border: 2px solid #FFD700;
}

.loading-message p {
    font-size: 20px;
    margin: 0;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    color: #FFF;
    opacity: 0.8;
}

/* Ensure OpenSeadragon viewer captures all touch events */
#openseadragon-viewer {
    touch-action: none;
}

/* Tutorial Modal */
.tutorial-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.tutorial-content {
    background-color: #2a2a2a;
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.tutorial-title {
    color: #FFD700;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}

.tutorial-section {
    margin-bottom: 30px;
}

.tutorial-section h3 {
    color: #FFD700;
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: bold;
}

.tutorial-section p {
    color: #e0e0e0;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.tutorial-section p strong {
    color: #FFF;
    font-weight: bold;
}

.tutorial-section .symbol {
    font-size: 24px;
    font-weight: 900;
    color: #FFD700;
}

.tutorial-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #FFD700;
}

.tutorial-checkbox {
    color: #e0e0e0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.tutorial-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #FFD700;
}

.tutorial-btn {
    background-color: #FFD700;
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.tutorial-btn:hover {
    background-color: #FFF;
    transform: scale(1.05);
}

/* Tutorial Mobile Responsive */
@media (max-width: 768px) {
    .tutorial-content {
        padding: 25px;
        width: 95%;
    }

    .tutorial-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .tutorial-section h3 {
        font-size: 18px;
    }

    .tutorial-section p {
        font-size: 14px;
    }

    .tutorial-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

/* Mine Map Card Styles */
.mine-map-card .map-image {
    background-color: #1a1a1a;
}

.mine-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.pdf-icon {
    width: 80px;
    height: 80px;
}

.pdf-icon svg {
    width: 100%;
    height: 100%;
}

/* PDF Modal Styles */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.pdf-modal-content {
    position: relative;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    border: 2px solid #FFD700;
    border-radius: 8px;
    overflow: hidden;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #2a2a2a;
    border-bottom: 2px solid #FFD700;
}

.pdf-header h2 {
    color: #FFD700;
    font-size: 24px;
    margin: 0;
    font-weight: bold;
}

.pdf-viewer-frame {
    flex: 1;
    width: 100%;
    border: none;
    background-color: #000;
}

@media (max-width: 768px) {
    .pdf-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .pdf-header h2 {
        font-size: 18px;
    }

    .pdf-icon {
        width: 60px;
        height: 60px;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-btn {
    background-color: #2a2a2a;
    color: #FFD700;
    border: 2px solid #FFD700;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Georgia', serif;
}

.page-btn:hover:not(:disabled) {
    background-color: #FFD700;
    color: #000;
    transform: scale(1.05);
}

.page-btn.active {
    background-color: #FFD700;
    color: #000;
}

.page-btn:disabled {
    background-color: #1a1a1a;
    color: #666;
    border-color: #666;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #FFD700;
    font-size: 20px;
    font-weight: bold;
    padding: 0 5px;
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }

    .page-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}
