@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Rajdhani:wght@300;500;600;700&display=swap');

:root {
    /* Futuristic Palette */
    --bg-deep: #050b14;
    --bg-dark: #0f172a;
    --bg-panel: rgba(22, 33, 62, 0.75);
    /* Slightly more opaque */

    --neon-blue: #00f3ff;
    --neon-blue-dim: rgba(0, 243, 255, 0.1);

    --neon-amber: #ffaa00;
    --neon-red: #ff2a2a;
    --neon-green: #00ff9d;

    --text-primary: #e0e6ed;
    --text-muted: #94a3b8;

    --glass-border: 1px solid rgba(0, 243, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 243, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 42, 42, 0.08) 0%, transparent 25%);
}

/* Layout Structure */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid rgba(0, 243, 255, 0.1);
    z-index: 10;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.logo-area {
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 2px solid var(--neon-blue);
    padding-bottom: 15px;
}

.logo-area h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--neon-blue);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-blue);
}

.subtitle {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-top: 5px;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 600;
    letter-spacing: 1px;
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(90deg, var(--neon-blue-dim) 0%, transparent 100%);
    color: var(--neon-blue);
    border-left-color: var(--neon-blue);
    text-shadow: 0 0 8px var(--neon-blue-dim);
}

.nav-item .icon {
    font-size: 1.2em;
    width: 25px;
    text-align: center;
}

.system-status {
    margin-top: auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid var(--neon-green);
    text-align: center;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px var(--neon-green);
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.server-time {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    margin-top: 5px;
    color: var(--neon-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    border-radius: 12px;
    flex-shrink: 0;
}

.neon-select {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 8px 15px;
    border-radius: 4px;
    font-family: var(--font-heading);
    cursor: pointer;
    outline: none;
}

.alert-level-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-indicator {
    padding: 5px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.level-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--neon-amber);
    border: 1px solid var(--neon-amber);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
    animation: pulse-amber 3s infinite;
}

@keyframes pulse-amber {
    0% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.2);
    }
}

.action-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 8px 20px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 14px;
}

.action-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

.danger-btn {
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.danger-btn:hover {
    background: var(--neon-red);
    color: white;
    box-shadow: 0 0 15px var(--neon-red);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--neon-blue);
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 12px;
}

/* Dashboard Grid */
.content-view {
    display: none;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    grid-template-rows: 250px 1fr;
    gap: 20px;
    height: 100%;
}

.panel {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.full-height {
    height: 100%;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Grid Areas */
.sensors-panel {
    grid-column: 1;
    grid-row: 1;
}

.ai-panel {
    grid-column: 3;
    grid-row: 1;
}

.map-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.rescue-panel {
    grid-column: 1;
    grid-row: 2;
}

.alerts-panel {
    grid-column: 3;
    grid-row: 2;
}

/* Sensors Dashboard Widget */
.sensor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex: 1;
}

.sensor-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.sensor-card:hover {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.sensor-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.sensor-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    font-family: 'Orbitron';
}

.sensor-status {
    font-size: 10px;
    margin-top: 5px;
    text-transform: uppercase;
}

.status-normal {
    color: var(--neon-green);
}

.status-warning {
    color: var(--neon-amber);
    animation: pulse-text 2s infinite;
}

/* AI Panel */
.ai-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.risk-meter-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.risk-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.risk-percentage {
    font-size: 32px;
    font-family: 'Orbitron';
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
}

.risk-label {
    font-size: 10px;
    color: var(--text-muted);
}

.ai-stats {
    width: 100%;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.highlight-blue {
    color: var(--neon-blue);
    font-weight: bold;
}

.highlight-red {
    color: var(--neon-red);
    font-weight: bold;
}

.highlight-amber {
    color: var(--neon-amber);
    font-weight: bold;
}

/* Map */
.map-container {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.map-controls {
    display: flex;
    gap: 8px;
}

.map-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 12px;
    font-size: 10px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s;
}

.map-btn:hover,
.map-btn.active {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
}

/* Rescue Panel */
.rescue-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.info-block {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    min-width: 100px;
}

.info-block.full-width {
    flex-basis: 100%;
    text-align: left;
}

.big-value {
    display: block;
    font-size: 36px;
    font-family: 'Orbitron';
    color: var(--text-primary);
}

.warning-text {
    color: var(--neon-amber);
}

.integrity-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    box-shadow: 0 0 10px var(--neon-green);
}

/* Alert Feed */
.alerts-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

.alert-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s;
    position: relative;
}

.alert-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.alert-item.critical {
    border-left-color: var(--neon-red);
}

.alert-item.warning {
    border-left-color: var(--neon-amber);
}

.alert-item.info {
    border-left-color: var(--neon-blue);
}

.alert-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: monospace;
}

.alert-msg {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ================= NEW SECTIONS STYLING ================= */

/* Neon Table */
.panel-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.neon-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--text-muted);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-body);
}

.neon-input:focus {
    border-color: var(--neon-blue);
    outline: none;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 10px;
}

.neon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.neon-table th {
    text-align: left;
    padding: 12px 15px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    border-bottom: 2px solid rgba(0, 243, 255, 0.2);
    font-size: 12px;
}

.neon-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.neon-table tr:hover td {
    background: rgba(0, 243, 255, 0.05);
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge.normal {
    background: rgba(0, 255, 157, 0.2);
    color: var(--neon-green);
}

.status-badge.warning {
    background: rgba(255, 170, 0, 0.2);
    color: var(--neon-amber);
}

.status-badge.critical {
    background: rgba(255, 42, 42, 0.2);
    color: var(--neon-red);
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 200px;
}

.bar-chart-visual {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    height: 150px;
    margin-bottom: 15px;
}

.bar {
    width: 30px;
    background: var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
    opacity: 0.7;
    transition: height 1s;
}

.bar.warning {
    background: var(--neon-amber);
    box-shadow: 0 0 15px var(--neon-amber);
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
}

.stat-item span {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}

.fill {
    height: 100%;
    background: var(--neon-blue);
}

.fill.warning {
    background: var(--neon-amber);
}

.val {
    float: right;
    font-family: 'Orbitron';
    font-size: 14px;
    color: var(--text-primary);
}

/* Routes */
.routes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.route-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--text-muted);
    padding: 20px;
    border-radius: 8px;
}

.route-card.safe {
    border-color: var(--neon-green);
}

.route-card.danger {
    border-color: var(--neon-red);
}

.route-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.route-header h3 {
    font-family: var(--font-heading);
    font-size: 14px;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.badge.success {
    background: var(--neon-green);
    color: black;
}

.badge.danger {
    background: var(--neon-red);
    color: white;
}

/* Units */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.unit-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 243, 255, 0.3);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.unit-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.unit-icon {
    font-size: 30px;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.unit-info h3 {
    font-family: var(--font-heading);
    color: var(--neon-blue);
    font-size: 16px;
    margin-bottom: 5px;
}

.unit-info p {
    font-size: 12px;
    color: var(--text-muted);
}



/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 240px 1fr;
        grid-template-rows: auto auto auto;
    }

    .sensors-panel {
        grid-column: 1;
        grid-row: 1;
    }

    .ai-panel {
        grid-column: 1;
        grid-row: 2;
        height: 300px;
    }

    .map-panel {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    .rescue-panel {
        grid-column: 1;
        grid-row: 3;
    }

    .alerts-panel {
        grid-column: 1 / span 2;
        grid-row: 4;
        height: 200px;
    }
}

/* SOS PANEL */
.sos-panel {
    border: 1px solid rgba(255, 80, 80, 0.25);
}

.sos-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #b8eaff;
    margin-bottom: 0.8rem;
}

.sos-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(5, 11, 20, 0.7);
    border: 1px solid rgba(0, 243, 255, 0.35);
    border-radius: 8px;
    padding: 10px;
    color: #e6faff;
    font-family: 'Rajdhani', sans-serif;
    resize: none;
    outline: none;
}

.sos-textarea::placeholder {
    color: rgba(184, 234, 255, 0.5);
}

.sos-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff3c3c, #ff9800);
    border: none;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #050b14;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sos-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(255, 80, 80, 0.6);
}

/* Pulse animation for urgency */
.pulse {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 8px rgba(255, 80, 80, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 80, 80, 0.9);
    }

    100% {
        box-shadow: 0 0 8px rgba(255, 80, 80, 0.4);
    }
}

/* ================= SOS EXTRAS ================= */

/* Scrollable SOS Feed */
.sos-feed {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: calc(100% - 60px);
    /* Adjust based on header */
    padding-bottom: 20px;
}

/* Scrollbar for SOS Feed */
.sos-feed::-webkit-scrollbar {
    width: 6px;
}

.sos-feed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sos-feed::-webkit-scrollbar-thumb {
    background: var(--neon-red);
    /* Red for SOS urgency */
    border-radius: 3px;
}

/* SOS Card Styling */
.sos-card {
    background: linear-gradient(145deg, rgba(20, 30, 48, 0.7), rgba(0, 0, 0, 0.8));
    border: 1px solid rgba(255, 80, 80, 0.2);
    border-radius: 8px;
    padding: 18px;
    /* Increased padding */
    cursor: pointer;
    transition: all 0.25s ease-out;
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
    /* Spacing between cards */
}

.sos-card:hover {
    background: rgba(255, 80, 80, 0.08);
    border-color: var(--neon-red);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 80, 80, 0.1);
}

.sos-card:active {
    transform: scale(0.99);
}

.sos-card.new {
    border-left: 0;
    /* Reset */
    box-shadow: inset 0 0 20px rgba(255, 42, 42, 0.1);
}

.sos-card.new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--neon-red);
    box-shadow: 0 0 12px var(--neon-red);
}

.sos-card.accepted {
    border-color: rgba(255, 170, 0, 0.5);
}

.sos-card.accepted::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--neon-amber);
}

.sos-card.accepted:hover {
    background: rgba(255, 170, 0, 0.08);
    border-color: var(--neon-amber);
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.1);
}

.sos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.sos-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
    opacity: 0.8;
}

.sos-body h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 1.1rem;
    /* Larger Name */
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.sos-loc {
    font-size: 0.8rem;
    color: var(--neon-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sos-desc {
    font-size: 0.9rem;
    color: #cbd5e1;
    /* Lighter grey */
    font-style: normal;
    /* Removed italic */
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.2);
    /* Slight container */
    padding: 8px;
    border-radius: 4px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.open {
    display: flex;
    opacity: 1;
}

.custom-modal-content {
    width: 90%;
    max-width: 500px;
    background: radial-gradient(circle at top left, #1a2c4e, #050b14);
    border: 1px solid var(--neon-red);
    box-shadow: 0 0 50px rgba(255, 42, 42, 0.15);
    padding: 0;
    /* Header/body split */
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.open .custom-modal-content {
    transform: scale(1);
}

.custom-modal-header {
    background: rgba(255, 42, 42, 0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 42, 42, 0.3);
}

.custom-modal-header h2 {
    font-family: var(--font-heading);
    color: var(--neon-red);
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 0 10px var(--neon-red);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.custom-modal-body {
    padding: 25px;
    color: var(--text-primary);
}

.sos-modal-detail-row {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.sos-modal-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.sos-modal-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.sos-modal-value.highlight {
    color: var(--neon-blue);
}

.custom-modal-actions {
    padding: 20px;
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.3);
}

.full-btn {
    flex: 1;
    padding: 15px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.btn-accept {
    background: rgba(0, 255, 157, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-accept:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px var(--neon-green);
}

.btn-reject {
    background: rgba(255, 42, 42, 0.1);
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.btn-reject:hover {
    background: var(--neon-red);
    color: #fff;
    box-shadow: 0 0 20px var(--neon-red);
}

/* ================= RESOURCE LOCATOR STYLES ================= */

.resource-popup {
    font-family: 'Rajdhani', sans-serif;
    color: #333;
    min-width: 200px;
    text-align: center;
}

.resource-popup h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.resource-icon-marker {
    transition: transform 0.2s;
}

.resource-icon-marker:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

/* Custom Leaflet Popup Overrides for Dark Theme */
.leaflet-popup-content-wrapper {
    background: rgba(10, 15, 30, 0.95);
    color: #fff;
    border: 1px solid var(--neon-blue);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.leaflet-popup-tip {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid var(--neon-blue);
}

.leaflet-popup-close-button {
    color: var(--neon-blue) !important;
}

/* Specific Resource Colors for text in popup if needed */
.res-type-hospital {
    color: #ff2a2a;
}

.res-type-shelter {
    color: #ffaa00;
}

.res-type-food {
    color: #00ff9d;
}

/* Evacuation Route Animations */
.safe-route-anim {
    animation: routeGlow 1.5s ease-in-out infinite alternate;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(0, 255, 157, 0.4));
}

@keyframes routeGlow {
    from {
        stroke-opacity: 0.6;
        fill-opacity: 0.4;
        filter: drop-shadow(0 0 2px rgba(0, 255, 157, 0.2));
    }

    to {
        stroke-opacity: 1;
        fill-opacity: 0.8;
        filter: drop-shadow(0 0 12px rgba(0, 255, 157, 0.6));
    }
}

/* Custom Marker Hover for SOS */
.sos-marker {
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(255, 42, 42, 0.5));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sos-marker:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 15px rgba(255, 42, 42, 0.8));
}

.pulse-danger {
    animation: dangerPulse 2s infinite;
}

@keyframes dangerPulse {
    0% {
        fill-opacity: 0.3;
        stroke-opacity: 0.8;
    }

    50% {
        fill-opacity: 0.6;
        stroke-opacity: 1;
    }

    100% {
        fill-opacity: 0.3;
        stroke-opacity: 0.8;
    }
}

/* ================= RESOURCE VIEW STYLING ================= */

.resource-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.res-filter.active {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

.resource-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.resource-card-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.resource-card-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.1);
}

.res-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.res-card-info {
    flex: 1;
}

.res-card-info h3 {
    margin: 0;
    font-size: 14px;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.res-card-meta {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

.res-type {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.res-dist {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.res-card-action {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--neon-blue);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

/* MINI MAP FOR SOS */
.mini-map-container {
    width: 100%;
    height: 200px;
    border-bottom: 2px solid var(--neon-blue);
    position: relative;
    z-index: 5;
    background: #000;
}

.mini-map-container .leaflet-container {
    background: transparent !important;
}


/* SOS VERIFICATION LAYOUT */
.sos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: 100%;
    margin-top: 10px;
}

.sos-verify-panel {
    border-left: 1px solid rgba(0, 243, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.verify-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.verify-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.verify-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.verify-section h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--neon-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Intelligence Badge */
.intel-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    font-family: var(--font-heading);
    margin-bottom: 15px;
    display: inline-block;
}

.intel-high {
    background: rgba(0, 255, 157, 0.15);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.intel-low {
    background: rgba(255, 42, 42, 0.15);
    color: var(--neon-red);
    border: 1px solid var(--neon-red);
}

/* News Card */
.verify-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-mini-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 4px;
    border-left: 2px solid var(--neon-blue);
}

.news-mini-card h4 {
    font-size: 13px;
    margin-bottom: 5px;
}

.news-mini-card p {
    font-size: 11px;
    color: var(--text-muted);
}

/* NASA Guardian Styles */
.nasa-data-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.nasa-val {
    color: var(--neon-amber);
    font-weight: bold;
}

.nasa-alert-banner {
    background: rgba(255, 170, 0, 0.1);
    color: var(--neon-amber);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 170, 0, 0.2);
    font-size: 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Enhanced Verification Styles */
.verify-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.reason-valid {
    color: var(--neon-green);
    font-weight: bold;
}

.reason-warn {
    color: var(--neon-amber);
    font-weight: bold;
}

.reason-critical {
    color: var(--neon-red);
    font-weight: bold;
}

.text-xs {
    font-size: 0.7em;
    opacity: 0.8;
}

.intel-med {
    background: rgba(255, 170, 0, 0.15);
    color: var(--neon-amber);
    border: 1px solid var(--neon-amber);
}

.action-btn.outline {
    background: transparent;
    border: 1px solid var(--neon-blue);
    margin-top: 10px;
    width: 100%;
}


/* ================= CALL INTERFACE STYLES ================= */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.call-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.call-container {
    width: 350px;
    height: 600px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(5, 11, 20, 0.95));
    border: 1px solid var(--neon-blue);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
    display: flex;
    flex-direction: column;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.secure-badge {
    color: var(--neon-green);
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.call-signal {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 15px;
}

.signal-bar {
    width: 3px;
    background: var(--neon-blue);
    height: 100%;
    opacity: 0.5;
}

.signal-bar:nth-child(4) {
    height: 100%;
    opacity: 1;
}

.signal-bar:nth-child(3) {
    height: 75%;
    opacity: 1;
}

.signal-bar:nth-child(2) {
    height: 50%;
    opacity: 0.8;
}

.signal-bar:nth-child(1) {
    height: 25%;
    opacity: 0.6;
}

.call-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: auto;
}

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--neon-blue), #0044ff);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
    position: relative;
}

.call-avatar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.call-avatar-text {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    font-family: var(--font-heading);
}

#call-name {
    font-size: 24px;
    margin-bottom: 5px;
    color: #fff;
    text-align: center;
}

#call-number {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.call-status {
    color: var(--neon-amber);
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 2px;
    animation: pulse-text 1.5s infinite;
}

.call-timer {
    font-family: monospace;
    color: var(--text-primary);
    font-size: 16px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.5s;
}

.call-timer.visible {
    opacity: 1;
}

.call-wave-visualizer {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 40px;
}

.wave-bar {
    width: 4px;
    height: 10px;
    background: var(--neon-blue);
    border-radius: 2px;
    animation: wave 1s infinite ease-in-out;
}

.wave-bar:nth-child(odd) {
    animation-duration: 0.8s;
}

.wave-bar:nth-child(even) {
    animation-duration: 1.1s;
}

@keyframes wave {

    0%,
    100% {
        height: 10px;
        opacity: 0.3;
    }

    50% {
        height: 40px;
        opacity: 1;
        box-shadow: 0 0 10px var(--neon-blue);
    }
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.call-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
    color: #fff;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.call-btn.secondary.active {
    background: #fff;
    color: #000;
}

.call-btn.danger {
    background: var(--neon-red);
    box-shadow: 0 0 20px rgba(255, 42, 42, 0.5);
}

.call-btn.danger:hover {
    background: #ff0000;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}