/* --- THEME SYSTEM VARIABLES --- */
:root { 
    --accent-color: #00E5FF; 
    --accent-glow: rgba(0, 229, 255, 0.4); 
    --bg-main: #050505;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-surface: rgba(20, 20, 25, 0.85);
    --input-bg: rgba(0,0,0,0.3);
    --nav-btn-bg: rgba(255,255,255,0.02);
    --nav-btn-active: rgba(255,255,255,0.08);
    --card-shadow: rgba(0, 0, 0, 0.37);
    --aurora-opacity: 0.5;
    --grid-line: rgba(128,128,128,0.05);
}

[data-theme="light"] {
    --bg-main: #eef2f6;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-surface: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(255, 255, 255, 0.6);
    --nav-btn-bg: rgba(255,255,255,0.5);
    --nav-btn-active: #ffffff;
    --card-shadow: rgba(148, 163, 184, 0.2);
    --aurora-opacity: 0.3;
    --grid-line: rgba(0,0,0,0.04);
}

/* --- CORE RESETS --- */
* { box-sizing: border-box; }
body { 
    background-color: var(--bg-main); color: var(--text-main); 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    margin: 0; padding: 0; width: 100%; min-height: 100vh; 
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* --- BACKGROUNDS --- */
.bg-grid { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -3; background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at center, black 40%, transparent 100%); }
.aurora-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; opacity: var(--aurora-opacity); background: radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.1), transparent 70%); pointer-events: none; }
.noise-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; opacity: 0.03; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); }

/* --- GLASS UI --- */
.glass-card { 
    background: var(--glass-bg); backdrop-filter: blur(24px); 
    border: 1px solid var(--glass-border); 
    box-shadow: 0 8px 32px 0 var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative; overflow: hidden;
}
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }

/* --- NAVIGATION --- */
.tab-btn { padding: 10px 20px; border-radius: 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); border: 1px solid transparent; transition: 0.3s; background: var(--nav-btn-bg); white-space: nowrap; cursor: pointer; }
.tab-btn.active { background: var(--nav-btn-active); border-color: var(--accent-color); color: var(--text-main); box-shadow: 0 0 15px var(--accent-glow); }

/* --- CRITICAL FIX: OVERLAYS & MODALS --- */
/* This section was missing, causing the black screen */

#securityScanOverlay { 
    position: fixed; inset: 0; z-index: 200; 
    background: #000; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
#securityScanOverlay.active { opacity: 1; pointer-events: auto; }

#mapFullModal { transition: opacity 0.3s; opacity: 0; pointer-events: none; }
#mapFullModal.active { opacity: 1; pointer-events: auto; }

#jaiHindModal, #aboutModal { transition: opacity 0.3s; }

#gridNavOverlay { 
    position: fixed; inset: 0; z-index: 9999; 
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease; 
}
#gridNavOverlay.open { opacity: 1; pointer-events: auto; }

#themeDropdown { 
    display: none; position: absolute; top: 110%; right: 0; 
    background: var(--glass-surface); backdrop-filter: blur(20px); 
    border: 1px solid var(--glass-border); border-radius: 16px; 
    width: 200px; z-index: 1000; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}

/* --- ANIMATIONS & DECORATION --- */
.radar-box { position: relative; width: 200px; height: 200px; border: 2px solid rgba(0, 229, 255, 0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 20px rgba(0, 229, 255, 0.2); }
.radar-sweep { position: absolute; width: 50%; height: 50%; top: 0; left: 0; border-right: 2px solid var(--accent-color); background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2)); transform-origin: 100% 100%; animation: radarSpin 2s linear infinite; }
.radar-dot { width: 10px; height: 10px; background: var(--accent-color); border-radius: 50%; box-shadow: 0 0 10px var(--accent-color); animation: pulse 1s infinite; }
@keyframes radarSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.scan-text { font-family: 'Space Grotesk', monospace; color: var(--accent-color); margin-top: 20px; font-size: 14px; letter-spacing: 2px; }
.blink { animation: blinker 0.5s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

.map-wrapper { position: relative; border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; box-shadow: 0 0 15px rgba(0, 229, 255, 0.1); }
.map-overlay-grid { position: absolute; inset: 0; pointer-events: none; z-index: 400; background-image: linear-gradient(rgba(0, 229, 255, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 229, 255, 0.1) 1px, transparent 1px); background-size: 40px 40px; opacity: 0.3; }
.scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); animation: scanMove 3s linear infinite; z-index: 401; pointer-events: none; }
@keyframes scanMove { 0% { top: 0; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* --- HELPERS --- */
.theme-opt { width: 100%; padding: 10px; border-radius: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-main); display: flex; align-items: center; gap: 10px; cursor: pointer; background: transparent; border: none; }
.theme-opt:hover { background: var(--nav-btn-active); color: var(--accent-color); }
.color-grid-item { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s; position: relative; }
.color-grid-item:hover { transform: scale(1.2); border-color: var(--text-main); }
.text-accent { color: var(--accent-color); }
.hidden { display: none !important; }

/* Form Elements */
input, select, textarea { background: var(--input-bg); border: 1px solid var(--glass-border); color: var(--text-main); outline: none; transition: 0.3s; width: 100%; }
input:focus { border-color: var(--accent-color); }
.drop-zone { border: 2px dashed var(--glass-border); border-radius: 16px; cursor: pointer; transition: 0.3s; text-align: center; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; background: rgba(0,0,0,0.02); margin-bottom: 20px; }
.drop-zone:hover { border-color: var(--accent-color); background: rgba(0, 229, 255, 0.05); }
.upload-icon-box { padding: 12px; border-radius: 50%; background: var(--nav-btn-bg); margin-bottom: 12px; transition: 0.3s; }
.drop-zone:hover .upload-icon-box { background: var(--accent-color); color: black; box-shadow: 0 0 15px var(--accent-glow); }

.pulse { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.pulse-green { background: #10b981; box-shadow: 0 0 12px #10b981; }
.pulse-yellow { background: #f59e0b; }
.pulse-red { background: #ef4444; }

/* Scroll & Mobile */
.scroll-track { width: 80px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 10px; margin: 0 auto 30px; position: relative; }
.scroll-thumb { height: 100%; background: var(--accent-color); border-radius: 10px; position: absolute; top: 0; left: 0; width: 20%; transition: left 0.1s; }
.hidden-input { display: none; }
.preview-thumb { width: 100%; height: 140px; object-fit: contain; border-radius: 8px; margin-bottom: 8px; display: none; background: rgba(0,0,0,0.1); }
.btn-premium { background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1)); border: 1px solid var(--glass-border); color: var(--text-main); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; transition: all 0.3s; position: relative; overflow: hidden; }
.btn-premium:hover { border-color: var(--accent-color); box-shadow: 0 0 20px var(--accent-glow); color: var(--accent-color); }
.flag-container { display: flex; flex-direction: column; width: 24px; height: 16px; border-radius: 2px; overflow: hidden; opacity: 0.8; box-shadow: 0 0 10px rgba(255,255,255,0.1); cursor: pointer; transition: transform 0.3s ease; }
.flag-container:hover { transform: scale(1.15); }
.flag-saffron { flex: 1; background: #FF9933; }
.flag-white { flex: 1; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.flag-green { flex: 1; background: #138808; }
.ashoka-chakra { width: 4px; height: 4px; border: 0.5px solid #000080; border-radius: 50%; }
.scale-option { padding: 8px 16px; border: 1px solid var(--glass-border); border-radius: 8px; cursor: pointer; transition: 0.3s; font-size: 12px; font-weight: bold; background: var(--nav-btn-bg); }
.scale-option.active { background: var(--accent-color); color: black; border-color: var(--accent-color); }
.scale-option.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
