/* =============================
   SSMS - Smart Society Management System
   Premium Glassmorphism Design
   ============================= */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg: #f1f5f9;
    --surface: rgba(255,255,255,0.7);
    --surface-border: rgba(255,255,255,0.5);
    --text: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 8px 32px rgba(0,0,0,0.1);
    --navbar-h: 64px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: rgba(30,41,59,0.8);
    --surface-border: rgba(255,255,255,0.1);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.05) 50%, rgba(16,185,129,0.05) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 1;
}
.glass-card:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }

/* ===== NAVBAR ===== */
.glass-navbar {
    background: var(--surface) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--surface-border);
    height: var(--navbar-h);
    z-index: 1000;
}
.glass-navbar .navbar-brand { color: var(--primary) !important; font-size: 1.3rem; }
.glass-navbar .nav-link { color: var(--text) !important; padding: 0.5rem 0.8rem; border-radius: 8px; transition: all 0.2s; }
.glass-navbar .nav-link:hover { background: rgba(99,102,241,0.1); color: var(--primary) !important; }
.brand-text { background: linear-gradient(135deg, #6366f1, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ===== MAIN CONTENT ===== */
.main-content { padding-top: calc(var(--navbar-h) + 20px); min-height: 100vh; }

/* ===== STAT CARDS ===== */
.stat-card { padding: 1.5rem; cursor: pointer; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.4rem; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.bg-primary-soft { background: rgba(99,102,241,0.15); }
.bg-success-soft { background: rgba(16,185,129,0.15); }
.bg-warning-soft { background: rgba(245,158,11,0.15); }
.bg-danger-soft { background: rgba(239,68,68,0.15); }
.bg-info-soft { background: rgba(6,182,212,0.15); }
.text-primary { color: var(--primary) !important; }

/* ===== TABLES ===== */
.ssms-table { color: var(--text); }
.ssms-table thead th {
    background: rgba(99,102,241,0.1);
    color: var(--text);
    font-weight: 600;
    border: none;
    padding: 0.9rem 1rem;
}
.ssms-table tbody tr { transition: background 0.2s; }
.ssms-table tbody tr:hover { background: rgba(99,102,241,0.05); }
.ssms-table td { padding: 0.85rem 1rem; border-color: var(--surface-border); vertical-align: middle; }

/* ===== NEON BUTTONS ===== */
.btn-primary, .neon-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600;
    transition: all 0.3s !important;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-primary:hover, .neon-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(99,102,241,0.6) !important;
}
.btn-primary:active, .neon-btn:active { transform: translateY(0) !important; }

/* Ripple effect */
.btn { position: relative; overflow: hidden; }
.btn::after {
    content: '';
    position: absolute;
    width: 0; height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}
.btn:active::after { width: 200px; height: 200px; }

/* ===== FLOATING LABELS ===== */
.floating-label-group { position: relative; }
.floating-input { border-radius: 10px; border: 2px solid var(--surface-border); background: var(--surface); color: var(--text); padding: 1rem 1rem 0.5rem; transition: all 0.2s; }
.floating-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.floating-label {
    position: absolute; top: 0.9rem; left: 1rem;
    color: var(--text-muted); font-size: 0.9rem;
    transition: all 0.2s; pointer-events: none;
}
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 0.3rem; font-size: 0.7rem; color: var(--primary);
}
.input-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.toggle-pass { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }

/* ===== PAGE HEADER ===== */
.page-header { border-bottom: 1px solid var(--surface-border); padding-bottom: 1rem; }
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 0; }
.section-title { font-weight: 600; color: var(--text); border-bottom: 2px solid rgba(99,102,241,0.3); padding-bottom: 0.5rem; margin-bottom: 1rem; }

/* ===== NOTICES & LISTS ===== */
.notice-item, .visitor-item {
    padding: 0.75rem; border-radius: 8px; margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
    background: rgba(99,102,241,0.05);
    transition: background 0.2s;
}
.notice-item:hover, .visitor-item:hover { background: rgba(99,102,241,0.1); }
.reply-box { background: rgba(16,185,129,0.1); border-left: 3px solid var(--success); border-radius: 8px; }
.notif-item { border-left: 3px solid var(--info); }
.notif-unread { background: rgba(6,182,212,0.1) !important; }

/* ===== PROFILE / NOTIFICATIONS ===== */
.btn-profile {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-profile:hover { background: rgba(99,102,241,0.1); }
.btn-notif {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-notif:hover { background: rgba(99,102,241,0.1); color: var(--primary); }
.notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: white;
    border-radius: 50%; width: 18px; height: 18px;
    font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.theme-toggle:hover { background: rgba(99,102,241,0.15); color: var(--primary); transform: rotate(20deg); }
.login-theme-toggle { position: fixed; top: 1rem; right: 1rem; z-index: 999; }

/* ===== LOGIN PAGE ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-bg { position: fixed; inset: 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6B73FF 100%); z-index: -1; }
.drop { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05); animation: dropFloat 6s infinite; }
.drop-1 { width: 80px; height: 80px; top: 20%; left: 10%; animation-delay: 0s; }
.drop-2 { width: 120px; height: 120px; top: 60%; right: 15%; animation-delay: 2s; }
.drop-3 { width: 60px; height: 60px; bottom: 20%; left: 40%; animation-delay: 4s; }
@keyframes dropFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.1); }
}
.login-container { width: 100%; max-width: 440px; padding: 1rem; }
.login-card {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.3) !important;
    padding: 2.5rem;
    color: white;
}
[data-theme="dark"] .login-card { background: rgba(15,23,42,0.7) !important; }
.login-logo {
    width: 72px; height: 72px; border-radius: 20px; margin: 0 auto;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border: 2px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: white;
}
.login-card h2 { color: white; }
.login-card .text-muted { color: rgba(255,255,255,0.7) !important; }
.login-tabs { display: flex; background: rgba(255,255,255,0.1); border-radius: 10px; padding: 4px; gap: 4px; }
.tab-btn {
    flex: 1; padding: 0.5rem; border: none; background: transparent; color: rgba(255,255,255,0.7);
    border-radius: 8px; cursor: pointer; transition: all 0.3s; font-size: 0.85rem; font-weight: 500;
}
.tab-btn.active { background: rgba(255,255,255,0.2); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.login-card .floating-input {
    background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: white;
}
.login-card .floating-input::placeholder { color: transparent; }
.login-card .floating-input:focus { border-color: white; box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.login-card .floating-label { color: rgba(255,255,255,0.7); }
.login-card .floating-input:focus ~ .floating-label,
.login-card .floating-input:not(:placeholder-shown) ~ .floating-label { color: white; }
.btn-login {
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1)) !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    color: white !important; font-weight: 600; padding: 0.8rem; border-radius: 10px; font-size: 1rem;
    backdrop-filter: blur(10px); transition: all 0.3s !important;
}
.btn-login:hover { background: rgba(255,255,255,0.25) !important; transform: translateY(-2px) !important; }
.demo-info { color: rgba(255,255,255,0.7) !important; }
.demo-info small { color: rgba(255,255,255,0.7) !important; }
.glass-dropdown {
    background: var(--surface) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
}
.glass-dropdown .dropdown-item { color: var(--text) !important; border-radius: 8px; margin: 2px 4px; }
.glass-dropdown .dropdown-item:hover { background: rgba(99,102,241,0.1) !important; color: var(--primary) !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-title { font-size: 1.2rem; }
    .stat-number { font-size: 1.5rem; }
    .glass-navbar .nav-link { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-up { animation: fadeInUp 0.5s ease forwards; }

/* ===== BADGE OVERRIDES ===== */
.badge { font-weight: 500; padding: 0.4em 0.75em; border-radius: 6px; }
.bg-primary-soft { background: rgba(99,102,241,0.15) !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ===== FORM CONTROLS DARK MODE ===== */
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.15);
    color: var(--text);
}
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
    background: rgba(30,41,59,0.9); border-color: var(--primary); color: var(--text);
}
[data-theme="dark"] .table { color: var(--text); }
[data-theme="dark"] .table-bordered td, [data-theme="dark"] .table-bordered th { border-color: var(--surface-border); }


/* ===== Logout Button Red Glass ===== */

.btn-logout {
    background: linear-gradient(135deg, #ff4d4d, #ff1a1a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff !important;
    font-weight: 600;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.25);
    transition: all 0.3s ease;
}

    .btn-logout:hover {
        background: linear-gradient(135deg, #ff1a1a, #cc0000);
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 12px 30px rgba(255, 0, 0, 0.35);
    }

    .btn-logout:active {
        transform: scale(0.97);
    }

/* Dark theme adjust */
html[data-theme="dark"] .btn-logout {
    box-shadow: 0 8px 30px rgba(255, 0, 0, 0.45);
}

.user-name {
    color: var(--text) !important;
    font-weight: 600;
}

