/* ================================
   RESET & BASE
================================ */

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

:root {
    /* Colors from existing design */
    --green-base: #66d84a;
    --green-dark: #1b410f;
    --blue-centre: #0047aa;
    --blue-dark: #15508c;
    
    /* Premium palette */
    --bg-dark: #1e382b;
    --bg-darker: #ffffff;

    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Glass effects */
    --glass-bg: rgba(0,71,165, 0.2);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Change body to allow scrolling if there is more content */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-light);
    /* Remove overflow: hidden; change height to min-height */
    overflow-x: hidden; 
    overflow-y: auto; 
    min-height: 100vh;
}

/* ================================
   MAP SECTION - ensure it receives events
================================ */
.bhumi-map-section {
    position: relative;
    z-index: 50;
    isolation: isolate;

    /* Background image */
    background-image: 
        linear-gradient(
            135deg,
            rgba(19, 36, 29, 0.85),
            rgba(30, 56, 43, 0.85)
        ),
        url("assets/images/forest-bg.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


/* ================================
   CONTAINER LAYOUT
================================ */

.map-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* ================================
   LEFT PANEL: INFO
================================ */

.info-panel {
    position: relative;
    overflow: hidden;
    background: var(--bg-darker);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.info-panel.active {
    opacity: 1;
}

.info-panel-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.panel-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    overflow: hidden;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel.active .panel-image-wrapper {
    opacity: 1;
    transform: scale(1);
}

.panel-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, 
                                transparent, 
                                var(--bg-darker));
    z-index: 1;
}

.panel-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    z-index: 2;
    
    /* Glassmorphism container */
    background: rgba(30,56,43, 0.3);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.info-panel.active .panel-content {
    opacity: 1;
    transform: translateY(0);
}

.panel-content h2 {
    font-family: 'Syne', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
    letter-spacing: -0.02em;
}

.panel-meta {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: 50px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.panel-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 90%;
}

.panel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-item {
    padding: 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
}

.stat-item strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.stat-item span {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

/* ================================
   RIGHT PANEL: MAP
================================ */

.map-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    pointer-events: auto;  /*Ensure the panel itself doesn't block interactions with the map paths*/
}

.map-wrapper {
    width: 100%;
    max-width: 2000px;
    aspect-ratio: 1;
    position: relative;
    pointer-events: auto;
}

/* ================================
   SVG MAP STYLING
================================ */

#india-map {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: auto;
}

#india-map path {
    fill: var(--green-base);
    stroke: var(--green-dark);
    stroke-width: 0.6;
    cursor: pointer;
    transition: fill 0.3s ease;
    /* CRITICAL: Enable pointer events on the paths themselves */
    pointer-events: all !important; 
}

/* Add this to your CSS file */
#india-map path.centre-state.active-highlight {
    fill: #ffffff !important; /* Makes the active state pop */
    stroke: var(--blue-centre);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

/* Centre states (blue) */
#india-map path.centre-state {
    fill: var(--blue-centre);
    cursor: pointer;
    transition: filter 0.3s ease;
}

#india-map path.centre-state:hover {
    filter: brightness(1.2);
}

/* ================================
   HOVER CARD (on map)
================================ */

.hover-card {
    position: absolute;
    pointer-events: none !important; /* Ensure the card itself doesn't block interactions with the map paths */
    z-index: 100;
    pointer-events: none;
    /* Glassmorphism */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    
    /* Shadow */
    box-shadow: var(--glass-shadow);
    
    /* Hidden by default */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease; /* Remove left/top from transition for smoother movement */
    
    min-width: 250px;
    max-width: 300px;
}

.hover-card.active {
    opacity: 1;
    transform: translateY(0);
}

.hover-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.hover-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* ================================
   RESPONSIVE DESIGN
================================ */

@media (max-width: 1024px) {
    .map-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .info-panel {
        order: 2;
    }
    
    .map-panel {
        order: 1;
        padding: 2rem;
    }
    
    .panel-content {
        padding: 2rem;
    }
    
    .panel-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .map-panel {
        padding: 1rem;
    }
    
    .panel-content {
        padding: 1.5rem;
    }
    
    .panel-content h2 {
        font-size: 1.75rem;
    }
    
    .panel-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hover-card {
        min-width: 200px;
        padding: 1rem;
    }
    
    .hover-card h3 {
        font-size: 1rem;
    }
    
    .hover-card p {
        font-size: 0.85rem;
    }
}

/* ================================
   ANIMATIONS & MICRO-INTERACTIONS
================================ */

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

.stat-item {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-item:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-item:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-item:nth-child(4) {
    animation-delay: 0.4s;
}

.map-card {
    padding: 1.6rem 1.4rem;
    border-radius: 26px;

    background: rgba(24, 87, 163, 0.18);
    backdrop-filter: blur(18px);

    border: 1px solid rgba(255,255,255,0.35);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        0 30px 60px rgba(0,0,0,0.35);

    color: #fff;
    z-index: -5;
}
