/* css/dashboard.css - STRICT LIGHT THEME */

body {
    background-color: #f0f9ff;
    /* Login page jaisa light blue */
    color: #1e293b;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-bottom: 100px;
    /* Nav bar ke piche content na chhupe isliye extra space */
}

.dashboard-wrapper {
    padding: 25px 20px;
    max-width: 600px;
    /* Mobile first feel */
    margin: 0 auto;
}

/* Header & Icons */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.user-info h2 {
    font-size: 1.6rem;
    color: #2563eb;
    /* Primary Blue */
    margin: 0;
}

.greeting {
    color: #64748b;
    font-size: 0.9rem;
}

.top-actions {
    display: flex;
    gap: 12px;
}

.icon-circle {
    width: 42px;
    height: 42px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #475569;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

/* Info Cards (White theme) */
.info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.05);
    margin-bottom: 25px;
}

.info-card p {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
    margin: 0;
}

.icon-box {
    min-width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.section-title {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 12px;
    font-weight: bold;
}

/* 🚨 SOS Container 🚨 */
.sos-container {
    position: relative;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.sos-btn {
    position: relative;
    z-index: 10;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: 8px solid #ffffff;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(255, 75, 43, 0.3);
    border-style: solid;
    /* fix default button borders */
}

.sos-text {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: -5px;
}

.hold-text {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* The Progress Ring */
.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    pointer-events: none;
    z-index: 5;
}

.progress-ring__circle {
    stroke-dasharray: 660;
    stroke-dashoffset: 660;
    stroke-linecap: round;
    stroke: #2563eb;
    transition: stroke-dashoffset 0.1s linear;
}

/* ========================================= */
/* 🌟 FLOATING BOTTOM NAV BAR (Fixed) 🌟     */
/* ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    /* Centered on desktop */
    width: calc(100% - 40px);
    max-width: 560px;
    /* Matches wrapper */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 10px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-item.active {
    color: #2563eb;
    /* Blue active state */
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

/* ========================================= */
/* 💻 DESKTOP & TABLET RESPONSIVENESS 💻     */
/* ========================================= */

@media (min-width: 768px) {
    body {
        background-color: #e2e8f0;
        /* Desktop par bahar ka bg thoda dark hoga */
    }

    .dashboard-wrapper {
        background-color: #f0f9ff;
        max-width: 900px;
        /* App ki width badha di */
        width: 100%;
        margin: 40px auto;
        /* Center karne ke liye */
        padding: 40px;
        border-radius: 25px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
        /* Ek badi "App" jaisa feel */

        /* Grid Layout */
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2 barabar Columns */
        grid-template-rows: auto auto 1fr;
        column-gap: 50px;
        min-height: calc(100vh - 80px);
        /* Height manage karne ke liye */
    }

    /* Header dono column ke upar rahega */
    .top-bar {
        grid-column: 1 / 3;
        margin-bottom: 30px;
    }

    /* SOS Button ko Left me shift kiya */
    .sos-container {
        grid-column: 1 / 2;
        grid-row: 2 / 4;
        height: 100%;
        min-height: 350px;
    }

    /* Motivational Quote aur Tips ko Right me set kiya */
    .info-card:not(.tip-card) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        align-self: end;
    }

    .tips-section {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
        align-self: start;
        margin-top: 10px;
    }

    /* Bottom Nav ko Mac-Dock ki tarah center me float kiya */
    .bottom-nav {
        max-width: 450px;
        bottom: 30px;
        padding: 18px 20px;
    }

    /* Desktop par Hover Animation */
    .sos-btn:hover {
        transform: scale(1.03);
        transition: transform 0.2s ease-in-out;
    }
}

/* ==========================================
   🚨 SOS RED WAVE (PULSE) ANIMATION
   ========================================== */

/* 1. Animation ka logic (Wave kaise failegi) */
@keyframes pulse-red-wave {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8);
        /* Dark red wave shuru hogi */
    }

    70% {
        box-shadow: 0 0 0 40px rgba(239, 68, 68, 0);
        /* 40px tak failkar halki (transparent) ho jayegi */
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        /* Gayab */
    }
}

/* 2. Ye animation SOS button par lagana hai */
#sosBtn {
    /* Tumhari baaki purani styling waisi hi rahegi, bas ye line add karni hai */
    animation: pulse-red-wave 2s infinite ease-out;
}

.dashboard-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.08);
    /* Halka blue shadow */
    border: 1px solid #f1f5f9;
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

/* Profile Dropdown Styling */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    /* Default hidden */
    position: absolute;
    right: 0;
    top: 50px;
    /* Icon ke niche */
    background: white;
    min-width: 210px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    padding: 8px 0;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

.dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 12px 18px;
    background: #f8fafc;
}

.dropdown-header p {
    margin: 0;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9rem;
}

.dropdown-header span {
    font-size: 0.75rem;
    color: #64748b;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    color: #475569;
    font-size: 0.85rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: #eff6ff;
    color: #2563eb;
}

.dropdown-menu hr {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 4px 0;
}

#quickLogout {
    color: #ef4444;
}

#quickLogout:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2563eb;
}

input:checked+.slider:before {
    transform: translateX(21px);
}

.notif-item {
    background: white;
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    border-left: 5px solid #2563eb;
    transition: transform 0.2s;
}

.notif-item:hover {
    transform: translateX(5px);
}

.notif-danger {
    border-left-color: #ef4444;
    background: #fff1f2;
}

.notif-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.notif-success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

/* Notification Panel ko Glassmorphic look dene ke liye */
#notifPanel {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px !important;
    /* Zyada rounded corners */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

/* Har individual notification card */
.notif-card {
    transition: all 0.3s ease;
    border-left: 4px solid #cbd5e1;
    /* Default side border */
    position: relative;
    cursor: pointer;
}

.notif-card:hover {
    transform: translateX(5px);
    background: #f1f5f9 !important;
}

/* Type ke hisaab se colors */
.notif-sos {
    border-left-color: #ef4444;
    background: #fff1f2 !important;
}

.notif-admin {
    border-left-color: #3b82f6;
    background: #eff6ff !important;
}

.notif-community {
    border-left-color: #f59e0b;
    background: #fffbeb !important;
}

/* Notification Badge Pulsing Animation */
#notifBadge {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Base Card Style */
.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    background: #ffffff;
    border-radius: 15px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    overflow: hidden;
    /* Border ko fit rakhne ke liye */
    position: relative;
}

/* Left-side Color Accent (Ye wo patti hai jo tum chahte ho) */
.notif-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    /* Patti ki chaudai */
    border-radius: 4px 0 0 4px;
}

/* Category Colors */
.type-danger::before {
    background-color: #ef4444;
}

/* Red: Danger/Admin Delete */
.type-sos::before {
    background-color: #3b82f6;
}

/* Blue: SOS */
.type-community::before {
    background-color: #f59e0b;
}

/* Yellow: Community Alert */

/* Icon container background */
.notif-icon-box {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#notifPanel {
    display: none;
    position: absolute;
    top: 60px;
    /* Mobile ke liye settings */
    right: -10px;
    /* Thoda right se chipka hua */
    width: 90vw;
    /* Screen ki 90% width lega mobile par */
    max-width: 350px;
    /* Desktop par 350px se bada nahi hoga */
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Choti screen (Mobile) ke liye specific adjustment */
@media (max-width: 480px) {
    #notifPanel {
        right: -50px;
        /* Bell icon ke niche center karne ke liye */
        width: 85vw;
    }
}

.notif-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    /* Text ko wrap karne ke liye */
}

#notifPanel {
    display: none;
    position: absolute;
    top: 60px;
    right: 0;
    /* Desktop par right side se chipka rahega */
    width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* 📱 Mobile Specific Fix */

#notifPanel {
    display: none;
    position: absolute;
    top: 55px;
    /* Icon ke niche ki jagah */
    right: 0;
    /* Icon ke right edge se align hoga */
    width: 320px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    /* Animation profile dropdown jaisi */
    transform-origin: top right;
    transition: all 0.2s ease-out;
}

/* 📱 Mobile View Fix */
.emergency-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 24px;
    margin: 20px 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.emergency-header h3 {
    font-size: 1.2rem;
    color: #1e293b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.emergency-header p {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
}

.emergency-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.e-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 16px;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.e-card:active {
    transform: scale(0.97);
    background: #f1f5f9;
}

.e-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 15px;
}

.e-details {
    flex-grow: 1;
}

.e-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.e-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.arrow {
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* Colors for visual cues */
.police .e-icon {
    background: #e0f2fe;
    color: #0ea5e9;
}

.women .e-icon {
    background: #fdf2f8;
    color: #db2777;
}

.medical .e-icon {
    background: #fff7ed;
    color: #f97316;
}

.general .e-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

.e-card.police:active {
    border-color: #0ea5e9;
}

/* --- Base Styles (Pehle wala) --- */
.emergency-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 24px;
    margin: 20px 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Desktop ke liye base width auto rakhenge */
}

/* --- 💻 Desktop Specific Changes --- */
@media (min-width: 768px) {
    .emergency-section {
        max-width: 1000px;
        /* Box ki total width badha di */
        margin: 30px auto;
        /* Center mein lane ke liye */
        padding: 30px;
    }

    .emergency-header {
        text-align: center;
        /* Header center mein achha lagta hai desktop pe */
        margin-bottom: 30px;
    }

    .emergency-grid {
        display: grid;
        /* Desktop pe 1 column ke bajaye 2 ya 4 column kar sakte ho */
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        /* Cards ke beech zyada gap */
    }

    .e-card {
        padding: 20px;
        /* Card thoda bada lagega */
        border: 1px solid #f1f5f9;
    }

    .e-card:hover {
        background: #ffffff;
        transform: translateY(-5px);
        /* Hover effect desktop ke liye */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
        border-color: #cbd5e1;
    }
}

/* --- 🖥️ Large Screens (Optional: 4 columns) --- */
@media (min-width: 1100px) {
    .emergency-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .emergency-section {
        /* 1. Isse width manage hogi bina bahar bhage */
        width: 100%;
        max-width: 1100px;

        /* 2. Isse box center mein rahega */
        margin-left: auto;
        margin-right: auto;
        margin-top: 20px;
        margin-bottom: 20px;

        /* 3. Padding aur Box-Sizing (Zaroori!) */
        padding: 30px;
        box-sizing: border-box;
        /* Isse padding width ke andar hi rahegi */

        /* 4. Display fix */
        display: block;
        clear: both;
        /* Agar koi floating element hai toh use clear karega */
    }

    .emergency-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* 1. Main Notif Panel Fix */
#notifPanel {
    display: none;
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    max-width: 90vw;
    /* Mobile safety */
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    /* Header aur List ko round corners mein rakhega */
}

/* 2. Notification List Container */
#notifList {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    /* Cards ke charo taraf thodi jagah */
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    /* Firefox ke liye patla scrollbar */
}

/* 3. Notification Card Fix (The Real Fix) */
.notif-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    width: 100%;
    /* Bahar nahi jayega */
    box-sizing: border-box;
    /* Padding ko andar hi rakhega */
    transition: transform 0.2s;
}

.notif-card:hover {
    background: #f8fafc;
    transform: translateX(4px);
    /* Hover par thoda right move hoga, cool lagega */
}

/* Side indicator (Wo orange patti) */
.notif-card::before {
    content: '';
    width: 4px;
    height: 30px;
    background: #f59e0b;
    /* Yellow/Orange */
    border-radius: 10px;
    flex-shrink: 0;
}

#notifList::-webkit-scrollbar {
    width: 6px;
}

#notifList::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#notifList {
    padding: 10px;
    /* Panel ke andar thodi space */
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    /* Horizontal scroll ko bilkul band karo */
}

.notif-card {
    display: flex;
    align-items: flex-start;
    /* Icon upar rahe */
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    margin-bottom: 8px;
    width: 100% !important;
    /* Force internal width */
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.notif-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;

    /* 🚨 YE HAI MAIN FIX 🚨 */
    flex-shrink: 0;

    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.rotate-90 {
    display: inline-block;
    transform: rotate(90deg);
}