:root {
    /* GIS Gateway Color Palette (Restored Original) */
    --bg-dark: #020617; 
    --bg-card: rgba(15, 23, 42, 0.6); 
    --primary: #06b6d4; 
    --primary-glow: rgba(6, 182, 212, 0.5);
    --secondary: #3b82f6; 
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg-dark); color: var(--text-main); line-height: 1.6; min-height: 100vh; overflow-x: hidden; position: relative; }

/* ================= BACKGROUND EFFECTS ================= */
.spatial-grid { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 40px 40px; z-index: -2; pointer-events: none; }
.ambient-glow { position: fixed; top: -20%; left: 50%; transform: translateX(-50%); width: 80vw; height: 80vh; background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.1) 40%, rgba(0,0,0,0) 70%); filter: blur(80px); z-index: -1; pointer-events: none; }
#spatial-network { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: 0; 
    pointer-events: none; 
}
.hero-container, .feature-grid { position: relative; z-index: 1; }

/* ================= FLOATING GLASS NAV ================= */
.glass-nav { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 1000px; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(12px); border: 1px solid var(--border-glass); border-radius: 50px; padding: 10px 24px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; height: 40px; overflow: hidden; }
.logo img, .brand-logo { max-height: 40px !important; width: auto; object-fit: contain; }
.main-nav { display: flex; gap: 30px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: all 0.3s ease; }
.nav-link:hover, .nav-link.active { color: white; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.donate-btn { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.1); color: white; text-decoration: none; padding: 8px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--border-glass); transition: all 0.3s; }
.donate-btn:hover { background: #ef4444; border-color: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }

/* ================= PAGE ROUTING ================= */
.dashboard { padding: 120px 20px 60px; max-width: 1400px; margin: 0 auto; position: relative; z-index: 1; } 
.page-section { display: none; animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateY(20px); }
.page-section.active { display: block; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ================= HERO SECTION ================= */
.hero-container { max-width: 800px; margin: 0 auto; text-align: center; padding: 40px 0; }
.hero-badge { display: inline-block; font-size: 0.75rem; letter-spacing: 2px; padding: 6px 16px; margin-bottom: 25px; border-radius: 20px; background: rgba(6, 182, 212, 0.1); border: 1px solid rgba(6, 182, 212, 0.3); color: var(--primary); }
.hero-title { font-size: 4rem; font-weight: 300; line-height: 1.1; margin-bottom: 20px; letter-spacing: -1px; }
.text-gradient { background: linear-gradient(to right, #06b6d4, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; font-weight: 300; max-width: 600px; margin-left: auto; margin-right: auto; }
.glow-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border: none; padding: 14px 32px; border-radius: 30px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; box-shadow: 0 10px 25px var(--primary-glow); }
.glow-btn:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6); }

/* ================= HOME PAGE FEATURE GRID ================= */
.feature-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 24px; 
    margin-top: 60px; 
    max-width: 1000px; 
    margin-left: auto; 
    margin-right: auto; 
}

.feature-grid .glass-card {
    text-align: left;
    background: var(--bg-card); 
    backdrop-filter: blur(12px); 
    border: 1px solid var(--border-glass); 
    border-radius: 16px; 
    padding: 30px;
}

.card-icon { font-size: 2rem; margin-bottom: 15px; }
.feature-grid h3 { font-weight: 500; margin-bottom: 10px; font-size: 1.2rem; }
.feature-grid p { color: var(--text-muted); font-size: 0.95rem; }

/* ================= WIDGET GRID (SIDE-BY-SIDE) ================= */
.widget-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    width: 100%;
    align-items: start;
}

/* ================= THE CLICK-TO-EXPAND DRAWER & CORNER BORDERS ================= */
.clickable-drawer {
    border-radius: 16px;
    padding: 25px 30px; 
    border: 1px solid transparent; 
    transition: all 0.3s ease;
    position: relative;
    
    background: 
        linear-gradient(var(--text-muted), var(--text-muted)) top left / 20px 2px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) top left / 2px 20px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) top right / 20px 2px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) top right / 2px 20px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) bottom left / 20px 2px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) bottom left / 2px 20px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) bottom right / 20px 2px no-repeat,
        linear-gradient(var(--text-muted), var(--text-muted)) bottom right / 2px 20px no-repeat,
        var(--bg-card);
}

.clickable-drawer:not(.expanded):hover {
    background: 
        linear-gradient(var(--primary), var(--primary)) top left / 20px 2px no-repeat,
        linear-gradient(var(--primary), var(--primary)) top left / 2px 20px no-repeat,
        linear-gradient(var(--primary), var(--primary)) top right / 20px 2px no-repeat,
        linear-gradient(var(--primary), var(--primary)) top right / 2px 20px no-repeat,
        linear-gradient(var(--primary), var(--primary)) bottom left / 20px 2px no-repeat,
        linear-gradient(var(--primary), var(--primary)) bottom left / 2px 20px no-repeat,
        linear-gradient(var(--primary), var(--primary)) bottom right / 20px 2px no-repeat,
        linear-gradient(var(--primary), var(--primary)) bottom right / 2px 20px no-repeat,
        var(--bg-card);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

.clickable-drawer.expanded {
    background: rgba(15, 23, 42, 0.85); 
    border: 1px solid var(--border-glass); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.widget-header { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    user-select: none;
}

.widget-header h2 { 
    font-weight: 400; 
    font-size: 1.25rem; 
    margin: 0; 
    color: var(--text-main);
    transition: color 0.3s;
}

.clickable-drawer:not(.expanded):hover .widget-header h2 {
    color: var(--primary); 
}

.widget-expandable {
    display: grid;
    grid-template-rows: 0fr; 
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
}

.widget-content {
    overflow: hidden; 
    min-height: 0; 
    opacity: 0;
    transition: opacity 0.3s ease, padding-top 0.4s ease;
    padding-top: 0;
}

.clickable-drawer.expanded .widget-expandable {
    grid-template-rows: 1fr; 
}

.clickable-drawer.expanded .widget-content {
    opacity: 1;
    padding-top: 25px; 
    transition: opacity 0.4s ease 0.2s, padding-top 0.4s ease;
}

/* ================= FORM CONTROLS ================= */
.tags { display: flex; gap: 8px; }
.tag { background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); font-size: 0.7rem; padding: 4px 12px; border-radius: 20px; color: var(--text-muted); }
.description { font-size: 0.95rem; color: var(--text-muted); background: rgba(0,0,0,0.2); padding: 16px; border-left: 3px solid var(--primary); border-radius: 8px; margin-bottom: 30px; }
.highlight { color: white; font-weight: 600; }

.controls-container, .checkbox-group { background: rgba(0,0,0,0.2); padding: 20px; border-radius: 12px; border: 1px solid var(--border-glass); margin-bottom: 20px; }
.controls-container { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap;}
.checkbox-group { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

.imd-option-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.imd-sidebar { background: rgba(15, 23, 42, 0.45); border: 1px solid var(--border-glass); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.imd-step { padding: 10px 12px; border-radius: 10px; font-size: 0.77rem; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid transparent; background: rgba(255,255,255,0.02); }
.imd-step.active { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.35); color: #f8fafc; }
.imd-main { display: flex; flex-direction: column; gap: 18px; }
.imd-form-section { background: rgba(15, 23, 42, 0.35); border: 1px solid var(--border-glass); border-radius: 12px; padding: 14px 16px; }
.imd-form-header { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.imd-choice-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.imd-choice { display: inline-flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02); border: 1px solid transparent; color: #dbeafe; font-size: 0.9rem; cursor: pointer; }
.imd-choice input { display: none; }
.imd-radio { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-glass); background: rgba(15,23,42,0.8); display: inline-block; position: relative; }
.imd-choice input:checked + .imd-radio { border-color: var(--primary); }
.imd-choice input:checked + .imd-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }

.input-group { display: flex; flex-direction: column; flex: 1; }
.input-group label, .group-label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
select, .dark-input { background: rgba(15, 23, 42, 0.8); color: white; border: 1px solid var(--border-glass); padding: 12px 16px; border-radius: 8px; font-size: 1rem; outline: none; transition: all 0.3s; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select:focus, .dark-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2); }
.dark-input { margin-bottom: 15px; width: 100%; }

.coordinate-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.coordinate-input-grid .dark-input { margin-bottom: 0; }

.custom-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; color: #cbd5e1; user-select: none; }
.custom-checkbox input { display: none; }
.checkmark { width: 18px; height: 18px; background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-glass); border-radius: 4px; display: flex; justify-content: center; align-items: center; transition: all 0.2s; }
.custom-checkbox input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.custom-checkbox input:checked ~ .checkmark::after { content: "✔"; color: white; font-size: 12px; }

@media (max-width: 900px) {
    .imd-option-shell { grid-template-columns: 1fr; }
    .imd-sidebar { flex-direction: row; flex-wrap: wrap; }
    .imd-step { flex: 1 1 calc(50% - 10px); }
}

/* ================= PROGRESS BAR ================= */
.hidden { display: none !important; }
.progress-section { margin-top: 25px; padding-top: 25px; border-top: 1px solid var(--border-glass); }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; }
#statusText, #demStatusText { color: var(--primary); }
.progress-bar-bg { width: 100%; background: rgba(0,0,0,0.3); border-radius: 10px; height: 8px; overflow: hidden; border: 1px solid var(--border-glass); }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); width: 0%; transition: width 0.4s; box-shadow: 0 0 10px var(--primary-glow); }

/* ================= THEME TOGGLE BUTTON ================= */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.3s, background 0.3s;
}

.theme-toggle-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ================= PEOPLE PAGE STYLES ================= */
.people-main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--text-main);
}

.people-header {
    text-align: center;
    margin-bottom: 50px;
}

.people-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.people-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.people-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.person-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.person-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
}

@media (min-width: 768px) {
    .person-card {
        flex-direction: row;
    }
}

.person-image-container {
    flex-shrink: 0;
    width: 100%;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.person-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-details {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.person-details h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.person-role {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 15px;
}

.person-bio {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.person-links .linkedin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #0a66c2;
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.person-links .linkedin-btn:hover {
    background-color: #084e96;
}

/* ================= ENVELOPE OVERLAY & SUCCESS SCREEN ================= */
.envelope-overlay, .success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.envelope-overlay.active, .success-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Envelope Styling */
.envelope-wrapper {
    text-align: center;
    color: #fff;
}

.envelope {
    position: relative;
    width: 160px;
    height: 100px;
    background: #0077b6;
    border-radius: 4px;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: flyEnvelope 1.5s ease-in-out infinite alternate;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-top: 60px solid #00b4d8;
    transform-origin: top;
    transition: transform 0.4s ease;
}

.anim-text {
    font-family: inherit;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Envelope Flying Keyframes */
@keyframes flyEnvelope {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(2deg); }
}

/* Success Screen Styling */
.success-content {
    background: #ffffff;
    color: #333;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #2ec4b6;
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px auto;
}

.success-content button {
    margin-top: 20px;
    padding: 10px 20px;
    background: #0077b6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* ================= LIGHT MODE VARIABLES ================= */
body.light-mode {
    --bg-dark: #f1f5f9; 
    --bg-card: rgba(255, 255, 255, 0.7); 
    --primary: #0891b2; 
    --secondary: #2563eb; 
    --text-main: #0f172a; 
    --text-muted: #475569; 
    --border-glass: rgba(0, 0, 0, 0.1); 
}

body.light-mode .spatial-grid {
    background-image: 
        linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

body.light-mode .ambient-glow {
    background: radial-gradient(circle, rgba(8, 145, 178, 0.1) 0%, rgba(37, 99, 235, 0.1) 40%, rgba(255,255,255,0) 70%);
}

body.light-mode select, 
body.light-mode .dark-input {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
}

body.light-mode .controls-container, 
body.light-mode .checkbox-group,
body.light-mode .description {
    background: rgba(0, 0, 0, 0.03);
}

body.light-mode .custom-checkbox {
    color: var(--text-main);
}

body.light-mode .custom-checkbox .checkmark {
    background: rgba(255, 255, 255, 0.9);
}

body.light-mode .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .clickable-drawer.expanded {
    background: rgba(255, 255, 255, 0.95); 
}
/* Donate Page & QR Card Styling */
.donate-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
    color: #e2e8f0;
}

.donation-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.qr-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #06b6d4;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.qr-wrapper {
    margin: 20px auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
}

.gpay-qr-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
}

.upi-id-box {
    margin: 20px 0;
    background: rgba(30, 41, 59, 0.8);
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-btn {
    background: #06b6d4;
    color: #0f172a;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #0891b2;
    color: white;
}

/* Confirmation Button & Animated Checkmark */
.payment-confirm-box {
    margin-top: 25px;
    text-align: center;
}

.confirm-action-btn.success-state {
    background: #10b981 !important;
    color: white;
    pointer-events: none;
}

.checkmark-container {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #fff;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

.success-note {
    margin-top: 10px;
    color: #34d399;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Modal Overlay Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #0f172a;
    border: 1px solid rgba(6, 182, 212, 0.4);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    text-align: left;
    color: #e2e8f0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 8px;
    color: #06b6d4;
}

.modal-content p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
}

.modal-input:focus {
    outline: none;
    border-color: #06b6d4;
}

.secondary-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.primary-btn {
    background: #06b6d4;
    color: #0f172a;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #0891b2;
    color: white;
}

/* ================= LEAFLET MAP VISIBILITY & SIZING FIXES ================= */
#imdMap, #demMap {
    height: 280px !important;
    min-height: 280px !important;
    width: 100% !important;
    display: block !important;
    position: relative !important;
    z-index: 1;
}

.widget-content {
    overflow: visible !important;
}

/* ================= IMDWEB TRUE SPLIT-SCREEN LAYOUT ================= */
.imd-portal-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    width: 100%;
    max-width: 100% !important;
    height: calc(100vh - 140px);
    min-height: 680px;
    margin-top: 10px;
}

.imd-control-sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.imd-map-container-full {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    position: relative;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#imdMap {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: 16px;
    z-index: 1;
}

@media (max-width: 1100px) {
    .imd-portal-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .imd-map-container-full {
        height: 500px;
    }
}
/* ================= DATASET SELECTOR CARDS & POP-UP TRANSITIONS ================= */
.dataset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    max-width: 700px;
    margin: 30px auto;
    text-align: center;
}

.dataset-selector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 35px 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.dataset-selector-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dataset-selector-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.25);
}

.dataset-selector-card:hover::before {
    opacity: 1;
}

.dataset-icon-box {
    width: 75px;
    height: 75px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(6, 182, 212, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.dataset-selector-card:hover .dataset-icon-box {
    transform: scale(1.05);
    border-color: var(--primary);
}

.dataset-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

/* Smooth Pop-up Workspace Panels */
.workspace-panel {
    display: none;
    opacity: 0;
    transform: scale(0.96) translateY(25px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-panel.active {
    display: block;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.back-to-grid-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.back-to-grid-btn:hover {
    background: var(--primary);
    color: #0f172a;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}
/* ================= FIXED IMDWEB LAYOUT & SPACING ================= */
.dashboard {
    padding-top: 110px !important; /* Leaves clean clearance below the fixed glass nav bar */
    padding-bottom: 40px;
    max-width: 1450px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.imd-portal-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 30px;
    width: 100%;
    height: calc(100vh - 150px);
    min-height: 620px;
    align-items: center; /* Centers the sidebar and map vertically on screen */
    margin: 0 auto;
}

.imd-control-sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    overflow-y: auto;
    height: 100%;
    max-height: calc(100vh - 160px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.imd-map-container-full {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    position: relative;
    height: 100%;
    max-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#imdMap {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: 16px;
    z-index: 1;
}

@media (max-width: 1100px) {
    .imd-portal-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .imd-map-container-full {
        height: 500px;
    }
}