/* ==============================================
   SERS - Smart Emergency Response System
   Light Theme with Glassmorphism
   ============================================== */

/* ============ CSS Variables - LIGHT THEME ============ */
:root {
    --sers-bg: #f0f4f8;
    --sers-bg-alt: #e2e8f0;
    --sers-card: rgba(255, 255, 255, 0.7);
    --sers-card-solid: #ffffff;
    --sers-card-border: rgba(255, 255, 255, 0.5);
    --sers-primary: #2563eb;
    --sers-primary-light: #3b82f6;
    --sers-danger: #dc2626;
    --sers-danger-glow: rgba(220, 38, 38, 0.4);
    --sers-warning: #d97706;
    --sers-success: #059669;
    --sers-info: #0891b2;
    --sers-pending: #d97706;
    --sers-accepted: #2563eb;
    --sers-ontheway: #7c3aed;
    --sers-completed: #059669;
    --sers-text: #1e293b;
    --sers-text-secondary: #475569;
    --sers-muted: #64748b;
    --sers-glass: rgba(255, 255, 255, 0.55);
    --sers-glass-border: rgba(255, 255, 255, 0.6);
    --sers-glass-shadow: rgba(0, 0, 0, 0.06);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-primary);
    background: var(--sers-bg);
    color: var(--sers-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(37, 99, 235, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(5, 150, 105, 0.04) 0%, transparent 50%);
}

/* ============ Navbar ============ */
.sers-navbar {

    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.6rem 0;
    transition: var(--transition);
    z-index: 1050;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

.brand-icon {
    font-size: 1.5rem;
    margin-right: 0.4rem;
}

.brand-text {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #dc2626, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sers-navbar .nav-link {
    color: var(--sers-text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sers-navbar .nav-link:hover {
    color: var(--sers-primary) !important;
    background: rgba(37, 99, 235, 0.06);
}

.emergency-call-btn {
    font-weight: 600;
    padding: 0.45rem 1rem !important;
    border-radius: 50px !important;
    animation: pulse-btn 2s ease-in-out infinite;
}

/* ============ Main Content ============ */
.sers-main {
    min-height: calc(100vh - 160px);
    padding-top: 80px;
}

/* ============ Hero Section ============ */
.hero-section {
    text-align: center;
    padding: 3rem 0 2rem;
    position: relative;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: var(--sers-text);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--sers-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    font-weight: 400;
}

/* ============ SOS Button (Home) ============ */
.sos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    position: relative;
}

.sos-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, #ef4444, #dc2626, #991b1b);
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow:
        0 0 30px var(--sers-danger-glow),
        0 0 60px rgba(220, 38, 38, 0.2),
        0 8px 30px rgba(0, 0, 0, 0.15);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.sos-button:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 50px var(--sers-danger-glow),
        0 0 80px rgba(220, 38, 38, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.2);
}

.sos-button:active { transform: scale(0.95); }

.sos-button .sos-text { font-size: 2.8rem; font-weight: 900; letter-spacing: 4px; }
.sos-button .sos-subtitle { font-size: 0.7rem; font-weight: 500; letter-spacing: 2px; opacity: 0.9; margin-top: 2px; }

/* SOS ripple rings */
.sos-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid rgba(220, 38, 38, 0.35);
    z-index: 1;
}

.sos-ring-1 { animation: sos-ripple 2s ease-out infinite; }
.sos-ring-2 { animation: sos-ripple 2s ease-out infinite 0.5s; }
.sos-ring-3 { animation: sos-ripple 2s ease-out infinite 1s; }

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

/* ============ Dashboard SOS Button ============ */
.dash-sos-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dash-sos-button {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, #ef4444, #dc2626, #991b1b);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 25px var(--sers-danger-glow), 0 6px 20px rgba(0, 0, 0, 0.15);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
    position: relative;
}

.dash-sos-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px var(--sers-danger-glow), 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dash-sos-button:active { transform: scale(0.92); }
.dash-sos-text { font-size: 2rem; font-weight: 900; letter-spacing: 3px; }
.dash-sos-sub { font-size: 0.55rem; font-weight: 500; letter-spacing: 2px; opacity: 0.9; }

.dash-sos-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid rgba(220, 38, 38, 0.3);
    animation: sos-ripple 2s ease-out infinite;
    z-index: 1;
}

/* ============ Dashboard Service Cards ============ */
.dash-service-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.dash-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dash-service-card.ambulance::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
.dash-service-card.police::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.dash-service-card.fire::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

.dash-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.85);
}

.dash-service-card:active { transform: translateY(0) scale(0.97); }

.dash-svc-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.dash-service-card.ambulance .dash-svc-icon { color: #dc2626; }
.dash-service-card.police .dash-svc-icon { color: #2563eb; }
.dash-service-card.fire .dash-svc-icon { color: #d97706; }

.dash-svc-name { font-weight: 700; font-size: 0.9rem; color: var(--sers-text); }
.dash-svc-desc { font-size: 0.7rem; color: var(--sers-muted); margin-top: 2px; }
.dash-svc-badge { font-size: 1.3rem; margin-top: 0.5rem; }

/* ============ Feature Chips ============ */
.feature-chip {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sers-text-secondary);
    backdrop-filter: blur(8px);
}

/* ============ Emergency Service Buttons (Home) ============ */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.service-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.service-card.ambulance::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
.service-card.police::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.service-card.fire::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
}

.service-card .service-icon { font-size: 2.5rem; margin-bottom: 0.8rem; display: block; }
.service-card .service-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; color: var(--sers-text); }
.service-card .service-desc { font-size: 0.8rem; color: var(--sers-muted); }

/* ============ Glassmorphism Cards ============ */
.glass-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.glass-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }

/* ============ Emergency Form ============ */
.emergency-form { max-width: 500px; margin: 0 auto; }

.emergency-form .form-control,
.emergency-form .form-select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--sers-text);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.emergency-form .form-control:focus,
.emergency-form .form-select:focus {
    background: #fff;
    border-color: var(--sers-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    color: var(--sers-text);
}

.emergency-form .form-control::placeholder { color: var(--sers-muted); opacity: 0.7; }
.emergency-form label { font-weight: 500; font-size: 0.85rem; color: var(--sers-text-secondary); margin-bottom: 0.3rem; }

/* ============ Map Container ============ */
.map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    height: 300px;
    background: #fff;
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.map-container iframe { width: 100%; height: 100%; border: none; }

/* ============ Location Info Card ============ */
.location-info-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 1rem;
}

/* ============ Status Badge ============ */
.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
}

.status-pending {
    background: rgba(217, 119, 6, 0.1);
    color: var(--sers-pending);
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.status-accepted {
    background: rgba(37, 99, 235, 0.1);
    color: var(--sers-accepted);
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.status-ontheway {
    background: rgba(124, 58, 237, 0.1);
    color: var(--sers-ontheway);
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.status-completed {
    background: rgba(5, 150, 105, 0.1);
    color: var(--sers-completed);
    border: 1px solid rgba(5, 150, 105, 0.25);
}

/* ============ Status Dots (Legend) ============ */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.status-dot.emergency { background: #dc2626; }
.status-dot.pending { background: #2563eb; }
.status-dot.ontheway { background: #7c3aed; }
.status-dot.completed { background: #059669; }

/* ============ Progress Track ============ */
.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50px;
    overflow: hidden;
}

.progress-track-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--sers-primary), var(--sers-success));
    border-radius: 50px;
    transition: width 0.5s ease;
}

/* ============ Admin Dashboard ============ */
.stat-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card.total::after { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.stat-card.pending::after { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stat-card.ontheway::after { background: linear-gradient(90deg, #7c3aed, #8b5cf6); }
.stat-card.completed::after { background: linear-gradient(90deg, #059669, #10b981); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.stat-number { font-size: 2.5rem; font-weight: 900; line-height: 1; margin-bottom: 0.3rem; }
.stat-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--sers-muted); }

/* ============ Admin Tabs ============ */
.admin-tab {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--sers-text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.admin-tab:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--sers-primary);
    border-color: rgba(37, 99, 235, 0.15);
}

.admin-tab.active {
    background: var(--sers-primary);
    color: white;
    border-color: var(--sers-primary);
}

/* ============ Data Table ============ */
.sers-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sers-table thead th {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--sers-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.9rem 1rem;
    white-space: nowrap;
}

.sers-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sers-table tbody tr:hover { background: rgba(37, 99, 235, 0.03); }

.sers-table tbody td {
    padding: 0.8rem 1rem;
    font-size: 0.88rem;
    vertical-align: middle;
    color: var(--sers-text);
}

/* ============ Login Cards ============ */
.login-container { max-width: 420px; margin: 0 auto; padding-top: 6rem; }

.login-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--sers-text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
}

.login-card .form-control:focus {
    background: #fff;
    border-color: var(--sers-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    color: var(--sers-text);
}

.login-card .input-group-text {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--sers-muted);
}

/* ============ Buttons ============ */
.btn-sers-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none; color: white; font-weight: 600;
    padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-sers-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
    color: white;
}

.btn-sers-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: none; color: white; font-weight: 600;
    padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-sers-danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
    color: white;
}

.btn-sers-success {
    background: linear-gradient(135deg, #059669, #047857);
    border: none; color: white; font-weight: 600;
    padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-sers-success:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.25);
    color: white;
}

.btn-sers-warning {
    background: linear-gradient(135deg, #d97706, #b45309);
    border: none; color: white; font-weight: 600;
    padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-sers-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.25);
    color: white;
}

.btn-sers-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; }

/* ============ Service Type Badges ============ */
.service-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.service-ambulance { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.service-police { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.service-fire { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.service-sos { background: rgba(220, 38, 38, 0.15); color: #dc2626; font-weight: 800; }

/* ============ Loading Spinner ============ */
.sers-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--sers-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Quick Action Buttons ============ */
.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font-primary);
}

.quick-action-btn.danger {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.15);
}
.quick-action-btn.danger:hover { background: rgba(220, 38, 38, 0.15); transform: translateY(-2px); }

.quick-action-btn.primary {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.15);
}
.quick-action-btn.primary:hover { background: rgba(37, 99, 235, 0.15); transform: translateY(-2px); }

.quick-action-btn.success {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.15);
}
.quick-action-btn.success:hover { background: rgba(5, 150, 105, 0.15); transform: translateY(-2px); }

.quick-action-btn.info {
    background: rgba(8, 145, 178, 0.08);
    color: #0891b2;
    border: 1px solid rgba(8, 145, 178, 0.15);
}
.quick-action-btn.info:hover { background: rgba(8, 145, 178, 0.15); transform: translateY(-2px); }

/* ============ Profile Section ============ */
.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.profile-item:last-child { border-bottom: none; }
.profile-label { font-size: 0.82rem; color: var(--sers-muted); font-weight: 500; }
.profile-value { font-size: 0.88rem; font-weight: 600; color: var(--sers-text); }

/* ============ Smart Suggestions ============ */
.suggestion-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.suggestion-card.hospital { background: rgba(220, 38, 38, 0.04); border: 1px solid rgba(220, 38, 38, 0.1); }
.suggestion-card.police { background: rgba(37, 99, 235, 0.04); border: 1px solid rgba(37, 99, 235, 0.1); }
.suggestion-card:hover { transform: translateX(4px); }

.sugg-icon { font-size: 1.8rem; flex-shrink: 0; }
.suggestion-card.hospital .sugg-icon { color: #dc2626; }
.suggestion-card.police .sugg-icon { color: #2563eb; }

.sugg-label { font-size: 0.7rem; color: var(--sers-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.sugg-name { font-weight: 700; font-size: 0.9rem; color: var(--sers-text); }
.sugg-addr { font-size: 0.78rem; color: var(--sers-muted); }
.sugg-phone { font-size: 0.78rem; color: var(--sers-info); text-decoration: none; }
.sugg-phone:hover { text-decoration: underline; }

/* ============ Emergency Contacts ============ */
.contact-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    transition: var(--transition);
}

.contact-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }
.contact-name { font-weight: 700; font-size: 0.88rem; color: var(--sers-text); }
.contact-rel { font-size: 0.72rem; color: var(--sers-muted); }
.contact-phone { font-size: 0.78rem; color: var(--sers-primary); text-decoration: none; display: block; margin-top: 4px; }
.contact-phone:hover { text-decoration: underline; }

/* ============ Notifications ============ */
.notification-list { max-height: 300px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover { background: rgba(0, 0, 0, 0.02); }
.notif-unread { background: rgba(37, 99, 235, 0.03); border-left: 3px solid var(--sers-primary); }
.notif-read { opacity: 0.7; }
.notif-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.notif-msg { font-size: 0.82rem; color: var(--sers-text); line-height: 1.4; }
.notif-time { font-size: 0.7rem; color: var(--sers-muted); margin-top: 2px; }

/* ============ Toast Notification System ============ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.sers-toast {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
}

.sers-toast.show { transform: translateX(0); opacity: 1; }
.sers-toast.hide { transform: translateX(120%); opacity: 0; }

.sers-toast-success {
    background: rgba(5, 150, 105, 0.95);
    color: white;
}
.sers-toast-danger {
    background: rgba(220, 38, 38, 0.95);
    color: white;
}
.sers-toast-warning {
    background: rgba(217, 119, 6, 0.95);
    color: white;
}
.sers-toast-info {
    background: rgba(37, 99, 235, 0.95);
    color: white;
}

/* ============ Voice Trigger ============ */
.voice-active {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #dc2626 !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
    animation: pulse-voice 1.5s ease-in-out infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* ============ Alerts & Notifications ============ */
.sers-alert {
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    border: 1px solid;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideDown 0.3s ease-out;
}

.sers-alert-success { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.2); color: #059669; }
.sers-alert-danger { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.2); color: #dc2626; }
.sers-alert-warning { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.2); color: #d97706; }
.sers-alert-info { background: rgba(8, 145, 178, 0.08); border-color: rgba(8, 145, 178, 0.2); color: #0891b2; }

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

/* ============ Modal ============ */
.sers-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-xl);
    color: var(--sers-text);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.sers-modal-content .modal-header { border-bottom: 1px solid rgba(0, 0, 0, 0.06); }
.sers-modal-content .modal-footer { border-top: 1px solid rgba(0, 0, 0, 0.06); }

/* ============ Track Request ============ */
.track-card { max-width: 600px; margin: 0 auto; }

.status-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 2rem 0;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-50%);
}

.timeline-step { text-align: center; position: relative; z-index: 1; flex: 1; }

.timeline-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--sers-muted);
}

.timeline-step.active .timeline-dot {
    border-color: var(--sers-success);
    background: rgba(5, 150, 105, 0.1);
    color: var(--sers-success);
    box-shadow: 0 0 15px rgba(5, 150, 105, 0.2);
}

.timeline-step.current .timeline-dot {
    border-color: var(--sers-warning);
    background: rgba(217, 119, 6, 0.1);
    color: var(--sers-warning);
    animation: pulse-subtle 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.2);
}

.timeline-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sers-muted);
}

.timeline-step.active .timeline-label,
.timeline-step.current .timeline-label { color: var(--sers-text); }

/* ============ Location Info ============ */
.location-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(5, 150, 105, 0.06);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--sers-success);
}

.location-indicator.detecting {
    background: rgba(217, 119, 6, 0.06);
    border-color: rgba(217, 119, 6, 0.15);
    color: var(--sers-warning);
}

.location-indicator.error {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--sers-danger);
}

/* ============ Filter Bar ============ */
.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 0;
}

.filter-bar .form-select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--sers-text);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    min-width: 150px;
}

.filter-bar .form-select:focus {
    border-color: var(--sers-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ============ Reports ============ */
.report-card {
    background: var(--sers-glass);
    border: 1px solid var(--sers-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px var(--sers-glass-shadow);
}

.report-card h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--sers-text);
}

/* ============ Footer ============ */
.sers-footer {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
    color: var(--sers-text-secondary);
}

.sers-footer h5, .sers-footer h6 { font-weight: 700; color: var(--sers-text); }
.sers-footer a { color: var(--sers-text-secondary) !important; transition: var(--transition); }
.sers-footer a:hover { color: var(--sers-primary) !important; }

/* ============ Animations ============ */
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }

/* ============ Notification Popup ============ */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 400px;
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============ Call Popup ============ */
.call-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease-out;
    color: var(--sers-text);
}

.call-popup .call-icon { font-size: 3rem; animation: pulse-subtle 1s ease-in-out infinite; }

.call-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* ============ User Dashboard ============ */
.user-welcome-card {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.user-welcome-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 300px; height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .sos-button { width: 160px; height: 160px; }
    .sos-button .sos-text { font-size: 2.2rem; }
    .sos-ring { width: 160px; height: 160px; }
    .service-cards { grid-template-columns: 1fr; padding: 1rem; }
    .stat-number { font-size: 2rem; }
    .sers-table { font-size: 0.8rem; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-select { width: 100%; }
    .status-timeline { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .status-timeline::before { top: 0; bottom: 0; left: 18px; right: auto; width: 3px; height: auto; transform: none; }
    .timeline-step { display: flex; align-items: center; gap: 1rem; text-align: left; }
    .timeline-dot { margin: 0; flex-shrink: 0; }
    .dash-sos-button { width: 100px; height: 100px; }
    .dash-sos-text { font-size: 1.5rem; }
    .dash-sos-sub { font-size: 0.45rem; }
    .dash-sos-ring { width: 100px; height: 100px; }
    .toast-container { right: 10px; left: 10px; max-width: 100%; }
}

@media (max-width: 576px) {
    .sers-main { padding-top: 70px; }
    .hero-section { padding: 2rem 1rem 1rem; }
    .sos-button { width: 140px; height: 140px; }
    .sos-button .sos-text { font-size: 1.8rem; }
    .sos-ring { width: 140px; height: 140px; }
    .login-container { padding: 3rem 1rem; }
    .user-welcome-card { padding: 1rem 1.2rem; }
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--sers-bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ Selection ============ */
::selection { background: rgba(37, 99, 235, 0.2); color: var(--sers-text); }

/* ============ Form Controls (Dashboard) ============ */
.form-control-sm, .form-select-sm {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--sers-text);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
}

.form-control-sm:focus, .form-select-sm:focus {
    background: #fff;
    border-color: var(--sers-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    color: var(--sers-text);
}
