/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: #0f1115;
    color: #e2e8f0;
    line-height: 1.6;
    overflow: hidden;
}

#wrapper {
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* Map Section */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Sidebar Styling (Glassmorphism) */
#sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 450px;
    height: 100%;
    padding: 40px;
    background: rgba(15, 17, 21, 0.75); /* Highly transparent UI */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 2;
    transition: all 0.4s ease-in-out;
}

/* Ensures short content is perfectly centered vertically without suffering from top-clipping issues when scrolling long content */
#display-area {
    margin: auto 0;
    width: 100%;
}

/* Scrollbar for Sidebar */
#sidebar::-webkit-scrollbar {
    width: 6px;
}
#sidebar::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 10px;
}

.museum-placeholder {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    opacity: 0.8;
}

/* Exhibit Content Styling */
.exhibit-content {
    animation: fadeIn 0.5s ease-out forwards;
}

.exhibit-content h1 {
    color: #d4af37; /* Gold */
    margin-bottom: 5px;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    font-family: 'Cinzel', serif;
}

.exhibit-content .location {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 20px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exhibit-content img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s;
}

.exhibit-content img:hover {
    transform: scale(1.02);
}

.exhibit-content p {
    font-size: 1.08rem;
    color: #cbd5e1;
    margin-bottom: 20px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    line-height: 1.75;
}

.tag-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.era-tag, .category-tag {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-link {
    display: inline-block;
    padding: 10px 20px;
    background: #d4af37;
    color: #0f1115;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 10px;
    font-size: 0.9rem;
}

.article-link:hover {
    background: #fde047;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

/* Custom Map Marker */
.custom-marker {
    background: linear-gradient(135deg, #fde047, #d4af37);
    border: 0px solid #fff;
    border-radius: 50%;
    cursor: auto;
    width: 0.1px !important;
    height: 0.1px !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.custom-marker.visible-marker {
    width: 8px !important;
    height: 8px !important;
    margin-left: -4px !important;
    margin-top: -4px !important;
    border: 1px solid #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.8), inset 0 0 4px rgba(0,0,0,0.3);
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    z-index: 900 !important;
}

.custom-marker.visible-marker:hover,
.custom-marker.active-highlight {
    background: #fff;
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(255, 255, 255, 1);
    z-index: 1000 !important;
}

/* GeoJSON Highlights */
/* Defined in JS, but default leaflet path uses stroke/fill */
path.leaflet-interactive {
    transition: fill-opacity 0.3s, fill 0.3s, stroke-width 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Layout Update */
@media (max-width: 768px) {
    #sidebar { 
        width: 100%; 
        height: 45%; 
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px;
    }
}

/* Gold Tooltip applied to Leaflet Permanent Tooltips */
.leaflet-tooltip.gold-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #d4af37;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-shadow: 0px 2px 4px rgba(0,0,0,0.9), 0px 0px 8px rgba(0,0,0,0.8);
    opacity: 1 !important;
    white-space: nowrap;
}
.leaflet-tooltip.gold-tooltip::before {
    display: none; /* Hide default tooltip arrow */
}

/* Sidebar Accordions */
.state-header h1 {
    color: #fde047;
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-wrap: break-word;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 1.5px;
}
.state-intro {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 25px;
    line-height: 1.75;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
}
.section-title {
    color: #e2e8f0;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 10px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    letter-spacing: 1px;
}
details.exhibit-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: background 0.3s;
}
details.exhibit-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
summary {
    color: #d4af37;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 15px;
    padding-right: 40px;
    cursor: pointer;
    list-style: none;
    position: relative;
    outline: none;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
}
summary::-webkit-details-marker {
    display: none;
}
summary::after {
    content: '+';
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 1.4rem;
    transition: transform 0.3s;
}
details[open] summary::after {
    content: '-';
    transform: rotate(180deg);
}
details[open] .exhibit-content {
    padding: 0 15px 15px 15px;
}
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Glassmorphism Leaflet Zoom Controls */
.leaflet-bar {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3) !important;
    border: none !important;
}
.leaflet-control-zoom a {
    background: rgba(15, 17, 21, 0.6) !important;
    color: #d4af37 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
    transition: all 0.3s !important;
}
.leaflet-control-zoom a:hover {
    background: rgba(212, 175, 55, 0.2) !important;
    color: #fff !important;
}

/* Subtle State Labels on Map */
.state-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #d1d0c5 !important; /* Subtle light yellow-grey shade */
    font-family: 'Raleway', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
    opacity: 0.6;
    pointer-events: auto !important; /* Make text interactive */
    cursor: pointer;
}

/* ── Credit Tag ────────────────────────────────────────────────────────────── */
#credit-tag {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 999;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(212, 175, 55, 0.35);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    user-select: none;
}
#credit-tag:hover {
    color: rgba(212, 175, 55, 0.85);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ── Custom Cursor ────────────────────────────────────────────────────────── */
#cursor-dot, #cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
}

#cursor-dot {
    width: 6px;
    height: 6px;
    background-color: #d4af37;
}

#cursor-outline {
    width: 30px;
    height: 30px;
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    transition: width 0.3s ease, height 0.3s ease, transform 0.15s ease-out, opacity 0.3s ease;
}

/* Cursor Hover State */
body.cursor-hover #cursor-outline {
    width: 50px;
    height: 50px;
    background-color: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.8);
}

body.cursor-hover #cursor-dot {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.5;
}

/* Hide on mobile/tablets */
@media (max-width: 1024px) {
    #cursor-dot, #cursor-outline {
        display: none !important;
    }
    body {
        cursor: auto !important;
    }
}

/* Hide default cursor on desktop */
@media (min-width: 1025px) {
    body, a, button, .leaflet-interactive, .custom-marker, details summary,
    .leaflet-container, .leaflet-grab, .leaflet-grabbing {
        cursor: none !important;
    }
}

