/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary      : #2e7d32;
    --primary-light: #43a047;
    --primary-dark : #1b5e20;
    --primary-bg   : #e8f5e9;
    --accent       : #00c853;
    --white        : #ffffff;
    --gray-50      : #f9fafb;
    --gray-100     : #f3f4f6;
    --gray-200     : #e5e7eb;
    --gray-400     : #9ca3af;
    --gray-600     : #4b5563;
    --gray-800     : #1f2937;
    --danger       : #ef4444;
    --warning      : #f59e0b;
    --info         : #3b82f6;
    --success      : #10b981;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --shadow-sm    : 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md    : 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg    : 0 8px 32px rgba(0,0,0,0.12);
    --radius       : 12px;
    --radius-sm    : 8px;
    --transition   : all 0.25s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background : var(--gray-100);
    color      : var(--gray-800);
    font-size  : 15px;
    line-height: 1.6;
}

/* ── Animated background for auth pages ── */
/* ── Video background for auth pages ── */
.auth-body {
    min-height     : 100vh;
    display        : flex;
    align-items    : center;
    justify-content: center;
    padding        : 20px;
    position       : relative;
    overflow       : hidden;
    background     : #141414;
}

.auth-body::before {
    content        : '';
    position       : absolute;
    inset          : 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation      : bgMove 20s linear infinite;
    pointer-events : none;
}

@keyframes bgMove {
    from { background-position: 0 0; }
    to   { background-position: 60px 60px; }
}

/* Floating circles animation */
.auth-body::after {
    content        : '';
    position       : absolute;
    width          : 500px;
    height         : 500px;
    background     : radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius  : 50%;
    top            : -100px;
    right          : -100px;
    animation      : float 8s ease-in-out infinite;
    pointer-events : none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(30px) scale(1.05); }
}

/* ════════════════════════════════════════
   TOP NAVBAR
════════════════════════════════════════ */
.topbar {
    position  : fixed;
    top       : 0;
    left      : 0;
    right     : 0;
    height    : var(--topbar-height);
    background: var(--primary);
    display   : flex;
    align-items    : center;
    justify-content: space-between;
    padding   : 0 24px;
    z-index   : 1000;
    box-shadow: var(--shadow-md);
}

.topbar .brand {
    display    : flex;
    align-items: center;
    gap        : 10px;
    color      : var(--white);
    font-size  : 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing : 0.3px;
}

.topbar .brand .logo-icon {
    background   : rgba(255,255,255,0.2);
    border-radius: 8px;
    padding      : 6px 8px;
    font-size    : 18px;
}

.topbar-right {
    display    : flex;
    align-items: center;
    gap        : 16px;
}

.topbar-right .user-info {
    display    : flex;
    align-items: center;
    gap        : 8px;
    color      : rgba(255,255,255,0.9);
    font-size  : 14px;
}

.topbar-right .user-avatar {
    width        : 34px;
    height       : 34px;
    background   : rgba(255,255,255,0.25);
    border-radius: 50%;
    display      : flex;
    align-items  : center;
    justify-content: center;
    font-weight  : 600;
    font-size    : 14px;
    color        : white;
}

.topbar-right .btn-logout {
    background   : rgba(255,255,255,0.15);
    color        : white;
    border       : 1px solid rgba(255,255,255,0.3);
    padding      : 6px 14px;
    border-radius: var(--radius-sm);
    font-size    : 13px;
    font-weight  : 500;
    cursor       : pointer;
    text-decoration: none;
    transition   : var(--transition);
}

.topbar-right .btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

.sidebar-toggle {
    background: none;
    border    : none;
    color     : white;
    font-size : 22px;
    cursor    : pointer;
    padding   : 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
    display   : none;
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.15); }

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.sidebar {
    position  : fixed;
    top       : var(--topbar-height);
    left      : 0;
    width     : var(--sidebar-width);
    height    : calc(100vh - var(--topbar-height));
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index   : 900;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.sidebar-section {
    padding: 20px 12px 8px;
}

.sidebar-label {
    font-size    : 11px;
    font-weight  : 600;
    color        : var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding      : 0 8px;
    margin-bottom: 6px;
}

.sidebar-link {
    display      : flex;
    align-items  : center;
    gap          : 10px;
    padding      : 10px 12px;
    border-radius: var(--radius-sm);
    color        : var(--gray-600);
    text-decoration: none;
    font-size    : 14px;
    font-weight  : 500;
    transition   : var(--transition);
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--primary-bg);
    color     : var(--primary);
}

.sidebar-link.active {
    background: var(--primary-bg);
    color     : var(--primary);
    font-weight: 600;
}

.sidebar-link .icon {
    width      : 20px;
    text-align : center;
    font-size  : 16px;
    flex-shrink: 0;
}

.sidebar-divider {
    height    : 1px;
    background: var(--gray-200);
    margin    : 8px 12px;
}

/* ════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top : var(--topbar-height);
    padding    : 30px;
    min-height : calc(100vh - var(--topbar-height));
    transition : var(--transition);
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size  : 24px;
    font-weight: 700;
    color      : var(--gray-800);
    margin-bottom: 4px;
}

.page-header p {
    color    : var(--gray-400);
    font-size: 14px;
}

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
    background   : var(--white);
    border-radius: var(--radius);
    padding      : 24px;
    box-shadow   : var(--shadow-sm);
    border       : 1px solid var(--gray-200);
    margin-bottom: 24px;
    transition   : var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display        : flex;
    justify-content: space-between;
    align-items    : center;
    margin-bottom  : 20px;
    padding-bottom : 16px;
    border-bottom  : 1px solid var(--gray-200);
}

.card-header h3 {
    font-size  : 16px;
    font-weight: 600;
    color      : var(--gray-800);
}

/* ════════════════════════════════════════
   STAT CARDS
════════════════════════════════════════ */
.stats-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap          : 20px;
    margin-bottom: 28px;
}

.stat-card {
    background   : var(--white);
    border-radius: var(--radius);
    padding      : 22px 24px;
    box-shadow   : var(--shadow-sm);
    border       : 1px solid var(--gray-200);
    display      : flex;
    align-items  : center;
    gap          : 16px;
    transition   : var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform : translateY(-2px);
}

.stat-icon {
    width        : 52px;
    height       : 52px;
    border-radius: var(--radius-sm);
    display      : flex;
    align-items  : center;
    justify-content: center;
    font-size    : 22px;
    flex-shrink  : 0;
}

.stat-icon.green  { background: var(--primary-bg); }
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.yellow { background: #fffbeb; }
.stat-icon.red    { background: #fef2f2; }

.stat-info .number {
    font-size  : 28px;
    font-weight: 700;
    color      : var(--gray-800);
    line-height: 1.2;
}

.stat-info .label {
    font-size: 13px;
    color    : var(--gray-400);
    margin-top: 2px;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
    display      : inline-flex;
    align-items  : center;
    gap          : 6px;
    padding      : 9px 20px;
    border-radius: var(--radius-sm);
    border       : none;
    cursor       : pointer;
    font-size    : 14px;
    font-weight  : 600;
    text-decoration: none;
    transition   : var(--transition);
    white-space  : nowrap;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--primary);  color: white; }
.btn-success   { background: var(--success);  color: white; }
.btn-danger    { background: var(--danger);   color: white; }
.btn-warning   { background: var(--warning);  color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-outline   {
    background: transparent;
    color     : var(--primary);
    border    : 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); opacity: 1; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

.form-group label {
    display    : block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size  : 13px;
    color      : var(--gray-600);
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .icon {
    position : absolute;
    left     : 12px;
    top      : 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color    : var(--gray-400);
}

.input-icon-wrap input {
    padding-left: 38px !important;
}

.form-group input,
.form-group textarea,
.form-group select {
    width        : 100%;
    padding      : 10px 14px;
    border       : 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size    : 14px;
    font-family  : inherit;
    color        : var(--gray-800);
    background   : var(--white);
    transition   : var(--transition);
    outline      : none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow  : 0 0 0 3px rgba(46,125,50,0.12);
}

.form-group textarea { height: 130px; resize: vertical; }

.form-hint {
    font-size : 12px;
    color     : var(--gray-400);
    margin-top: 4px;
}

/* ════════════════════════════════════════
   ALERTS
════════════════════════════════════════ */
.alert {
    padding      : 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size    : 14px;
    font-weight  : 500;
    display      : flex;
    align-items  : center;
    gap          : 8px;
    animation    : slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef9c3; color: #854d0e; border-left: 4px solid #eab308; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
    width          : 100%;
    border-collapse: collapse;
    font-size      : 14px;
}

thead th {
    background   : var(--gray-50);
    color        : var(--gray-600);
    font-weight  : 600;
    font-size    : 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding      : 12px 16px;
    text-align   : left;
    border-bottom: 2px solid var(--gray-200);
}

tbody td {
    padding      : 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color        : var(--gray-800);
    vertical-align: middle;
}

tbody tr:hover td { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.badge {
    display      : inline-flex;
    align-items  : center;
    gap          : 4px;
    padding      : 3px 10px;
    border-radius: 20px;
    font-size    : 12px;
    font-weight  : 600;
    white-space  : nowrap;
}

.badge-high       { background: #fee2e2; color: #991b1b; }
.badge-medium     { background: #fef9c3; color: #854d0e; }
.badge-low        { background: #dcfce7; color: #166534; }
.badge-pending    { background: #ede9fe; color: #5b21b6; }
.badge-in-progress{ background: #fef9c3; color: #854d0e; }
.badge-resolved   { background: #dcfce7; color: #166534; }
.badge-rejected   { background: #fee2e2; color: #991b1b; }
.badge-general    { background: var(--gray-100); color: var(--gray-600); }
.badge-duplicate  { background: #fee2e2; color: #991b1b; }

/* ════════════════════════════════════════
   HERO (Home Page)
════════════════════════════════════════ */
.hero {
    background   : linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color        : white;
    padding      : 80px 40px;
    text-align   : center;
    border-radius: 20px;
    margin-bottom: 40px;
    position     : relative;
    overflow     : hidden;
}

.hero::before {
    content      : '';
    position     : absolute;
    top          : -50%;
    right        : -10%;
    width        : 400px;
    height       : 400px;
    background   : rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero h1 {
    font-size    : 44px;
    font-weight  : 700;
    margin-bottom: 16px;
    position     : relative;
}

.hero p {
    font-size    : 18px;
    opacity      : 0.88;
    margin-bottom: 32px;
    position     : relative;
}

.hero-btns {
    display        : flex;
    gap            : 14px;
    justify-content: center;
    flex-wrap      : wrap;
    position       : relative;
}

/* ════════════════════════════════════════
   AUTH PAGES (Login / Register)
════════════════════════════════════════ */
.auth-body {
    min-height     : 100vh;
    background     : linear-gradient(135deg, var(--primary-bg) 0%, #ffffff 100%);
    display        : flex;
    align-items    : center;
    justify-content: center;
    padding        : 20px;
}

.auth-card {
    background   : var(--white);
    border-radius: 20px;
    padding      : 44px 40px;
    width        : 100%;
    max-width    : 440px;
    box-shadow   : var(--shadow-lg);
    border       : 1px solid var(--gray-200);
    position     : relative;
    z-index      : 10;
}

.auth-logo {
    text-align   : center;
    margin-bottom: 32px;
}

.auth-logo .logo-circle {
    width        : 64px;
    height       : 64px;
    background   : var(--primary-bg);
    border-radius: 50%;
    display      : flex;
    align-items  : center;
    justify-content: center;
    font-size    : 28px;
    margin       : 0 auto 14px;
}

.auth-logo h2 {
    font-size  : 22px;
    font-weight: 700;
    color      : var(--gray-800);
}

.auth-logo p {
    font-size: 14px;
    color    : var(--gray-400);
    margin-top: 4px;
}

.auth-divider {
    text-align   : center;
    color        : var(--gray-400);
    font-size    : 13px;
    margin       : 20px 0;
    position     : relative;
}

.auth-divider::before,
.auth-divider::after {
    content   : '';
    position  : absolute;
    top       : 50%;
    width     : 42%;
    height    : 1px;
    background: var(--gray-200);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size : 14px;
    color     : var(--gray-400);
}

.auth-footer a {
    color      : var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* ════════════════════════════════════════
   CHARTS GRID
════════════════════════════════════════ */
.charts-grid {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap          : 24px;
    margin-bottom: 24px;
}

/* ════════════════════════════════════════
   MAP
════════════════════════════════════════ */
#complaint-map,
#admin-map {
    height       : 380px;
    border-radius: var(--radius-sm);
    z-index      : 1;
    border       : 1px solid var(--gray-200);
}

/* ════════════════════════════════════════
   CHATBOT
════════════════════════════════════════ */
.chatbot-widget {
    position: fixed;
    bottom  : 28px;
    right   : 28px;
    z-index : 9999;
}

.chatbot-btn {
    background   : var(--primary);
    color        : white;
    border       : none;
    border-radius: 50%;
    width        : 58px;
    height       : 58px;
    font-size    : 24px;
    cursor       : pointer;
    box-shadow   : var(--shadow-lg);
    transition   : var(--transition);
    display      : flex;
    align-items  : center;
    justify-content: center;
}

.chatbot-btn:hover { background: var(--primary-light); transform: scale(1.08); }

.chatbot-box {
    display      : none;
    width        : 320px;
    background   : var(--white);
    border-radius: var(--radius);
    box-shadow   : var(--shadow-lg);
    overflow     : hidden;
    margin-bottom: 12px;
    border       : 1px solid var(--gray-200);
    animation    : fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
    background : var(--primary);
    color      : white;
    padding    : 14px 16px;
    font-weight: 600;
    font-size  : 14px;
    display    : flex;
    align-items: center;
    gap        : 8px;
}

.chatbot-messages {
    height    : 240px;
    overflow-y: auto;
    padding   : 14px;
    font-size : 13px;
    background: var(--gray-50);
}

.chatbot-messages .bot {
    background   : var(--white);
    border       : 1px solid var(--gray-200);
    border-radius: 0 10px 10px 10px;
    padding      : 8px 12px;
    margin-bottom: 10px;
    color        : var(--gray-800);
    max-width    : 85%;
}

.chatbot-messages .user {
    background   : var(--primary-bg);
    border-radius: 10px 0 10px 10px;
    padding      : 8px 12px;
    margin-bottom: 10px;
    color        : var(--primary-dark);
    text-align   : right;
    margin-left  : auto;
    max-width    : 85%;
}

.chatbot-input {
    display   : flex;
    border-top: 1px solid var(--gray-200);
    padding   : 10px;
    background: var(--white);
    gap       : 8px;
}

.chatbot-input input {
    flex         : 1;
    border       : 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding      : 7px 12px;
    font-size    : 13px;
    outline      : none;
    font-family  : inherit;
}

.chatbot-input input:focus { border-color: var(--primary); }

.chatbot-input button {
    background   : var(--primary);
    color        : white;
    border       : none;
    border-radius: var(--radius-sm);
    padding      : 7px 14px;
    cursor       : pointer;
    font-size    : 13px;
    font-weight  : 600;
    transition   : var(--transition);
}

.chatbot-input button:hover { background: var(--primary-light); }

/* ════════════════════════════════════════
   HOME PAGE FEATURE CARDS
════════════════════════════════════════ */
.features-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap          : 20px;
    margin-bottom: 32px;
}

.feature-card {
    background   : var(--white);
    border-radius: var(--radius);
    padding      : 28px 24px;
    text-align   : center;
    border       : 1px solid var(--gray-200);
    box-shadow   : var(--shadow-sm);
    transition   : var(--transition);
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform : translateY(-4px);
    border-color: var(--primary-light);
}

.feature-card .f-icon {
    font-size    : 36px;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size    : 16px;
    font-weight  : 600;
    margin-bottom: 8px;
    color        : var(--gray-800);
}

.feature-card p {
    font-size: 13px;
    color    : var(--gray-400);
}

/* ════════════════════════════════════════
   LOGIN CHOICE CARDS (Home)
════════════════════════════════════════ */
.login-choice-grid {
    display              : grid;
    grid-template-columns: 1fr 1fr;
    gap          : 24px;
    margin-bottom: 32px;
}

.login-choice-card {
    background   : var(--white);
    border-radius: var(--radius);
    padding      : 36px 28px;
    text-align   : center;
    border       : 2px solid var(--gray-200);
    box-shadow   : var(--shadow-sm);
    transition   : var(--transition);
}

.login-choice-card:hover {
    box-shadow  : var(--shadow-md);
    transform   : translateY(-4px);
}

.login-choice-card.user-card  { border-top: 4px solid var(--primary); }
.login-choice-card.admin-card { border-top: 4px solid #7b1fa2; }

.login-choice-card .c-icon { font-size: 52px; margin-bottom: 16px; }
.login-choice-card h3 {
    font-size    : 20px;
    font-weight  : 700;
    margin-bottom: 10px;
}
.login-choice-card p {
    font-size    : 13px;
    color        : var(--gray-400);
    margin-bottom: 24px;
    line-height  : 1.6;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
footer {
    text-align: center;
    padding   : 24px;
    color     : var(--gray-400);
    font-size : 13px;
    border-top: 1px solid var(--gray-200);
    margin-top: 40px;
}

/* ════════════════════════════════════════
   NO SIDEBAR PAGES (Home, Auth)
════════════════════════════════════════ */
.no-sidebar .topbar { left: 0; }
.no-sidebar-content {
    margin-top: var(--topbar-height);
    padding   : 0;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }

    .sidebar {
        left     : calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }

    .sidebar.open {
        left      : 0;
        box-shadow: var(--shadow-lg);
    }

    .main-content { margin-left: 0; padding: 20px 16px; }

    .charts-grid          { grid-template-columns: 1fr; }
    .login-choice-grid    { grid-template-columns: 1fr; }
    .hero h1              { font-size: 28px; }
    .hero                 { padding: 50px 20px; }
    .auth-card            { padding: 32px 24px; }
}