/* ============================================
   File: assets/css/style.css
   Pen Nagarparishad E-Complaint Portal
   ============================================ */

:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --accent: #f97316;
    --accent-light: #fb923c;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --border: #dde3ea;
    --text: #1e293b;
    --text-muted: #64748b;
    --sidebar-w: 240px;
    --navbar-h: 64px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    min-height: 100vh;
}

/* ====== NAVBAR ====== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--navbar-h);
    background: var(--primary);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.logo-circle {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px;
    box-shadow: 0 2px 8px rgba(249,115,22,0.4);
}
.brand-text { display: flex; flex-direction: column; }
.brand-main {
    font-family: 'Noto Sans Devanagari', sans-serif;
    color: white; font-size: 16px; font-weight: 600; line-height: 1.2;
}
.brand-sub { color: rgba(255,255,255,0.7); font-size: 11px; letter-spacing: 0.5px; }
.navbar-right { display: flex; align-items: center; gap: 12px; }
.user-pill {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.1); border-radius: 20px;
    padding: 6px 14px; color: white; font-size: 13px;
}
.role-badge {
    font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; letter-spacing: 0.5px;
}
.role-badge.admin { background: var(--accent); color: white; }
.role-badge.operator { background: var(--info); color: white; }
.btn-logout {
    color: rgba(255,255,255,0.8); font-size: 18px; padding: 8px;
    border-radius: 8px; transition: all 0.2s; text-decoration: none;
}
.btn-logout:hover { color: white; background: rgba(255,255,255,0.1); }

/* ====== LAYOUT ====== */
.layout {
    display: flex;
    padding-top: var(--navbar-h);
    min-height: 100vh;
}

/* ====== SIDEBAR ====== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed; top: var(--navbar-h); bottom: 0; left: 0;
    overflow-y: auto;
    display: flex; flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}
.nav-menu { list-style: none; padding: 12px 0; flex: 1; }
.nav-menu li a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; color: var(--text-muted);
    text-decoration: none; font-size: 14px; font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.nav-menu li a:hover, .nav-menu li a.active {
    color: var(--primary-light); background: #eff6ff;
    border-left-color: var(--primary-light);
}
.nav-menu li a i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer {
    padding: 12px 20px; color: var(--text-muted); font-size: 11px;
    border-top: 1px solid var(--border); text-align: center;
}

/* ====== MAIN CONTENT ====== */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1; padding: 28px;
    min-height: calc(100vh - var(--navbar-h));
}

/* ====== PAGE HEADER ====== */
.page-header { margin-bottom: 24px; }
.page-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 26px; font-weight: 700; color: var(--primary);
}
.page-header p { color: var(--text-muted); margin-top: 4px; }

/* ====== STAT CARDS ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 28px;
}
.stat-card {
    background: var(--surface); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue { background: #dbeafe; color: var(--primary-light); }
.stat-icon.orange { background: #ffedd5; color: var(--accent); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ====== CARDS ====== */
.card {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px; font-weight: 600; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* ====== BIG COMPLAINT BUTTON ====== */
.btn-register-big {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    color: white; border: none; border-radius: var(--radius);
    padding: 18px 32px; font-size: 17px; font-weight: 700;
    cursor: pointer; text-decoration: none; width: 100%;
    box-shadow: 0 4px 16px rgba(249,115,22,0.35);
    transition: all 0.2s; letter-spacing: 0.3px;
    font-family: 'Rajdhani', sans-serif;
}
.btn-register-big:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249,115,22,0.45);
    color: white;
}
.btn-register-big i { font-size: 22px; }

/* ====== FORMS ====== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-group label .req { color: var(--danger); }
.form-control {
    border: 1.5px solid var(--border); border-radius: 8px;
    padding: 10px 14px; font-size: 14px; color: var(--text);
    font-family: 'Inter', sans-serif; background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
.form-control:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,0.1);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* Complaint Type Buttons */
.complaint-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.complaint-type-btn {
    border: 2px solid var(--border); border-radius: 10px; padding: 12px 8px;
    cursor: pointer; text-align: center; transition: all 0.2s; background: white;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.complaint-type-btn:hover { border-color: var(--primary-light); color: var(--primary-light); background: #eff6ff; }
.complaint-type-btn.selected { border-color: var(--primary-light); background: var(--primary-light); color: white; }
.complaint-type-btn i { font-size: 20px; }

/* Photo Upload */
.photo-upload-area {
    border: 2px dashed var(--border); border-radius: 10px;
    padding: 24px; text-align: center; cursor: pointer;
    transition: all 0.2s; background: #fafafa;
}
.photo-upload-area:hover { border-color: var(--primary-light); background: #eff6ff; }
.photo-upload-area i { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; }
.photo-upload-area p { color: var(--text-muted); font-size: 13px; }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 8px; border: none;
    font-size: 14px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--primary-light); color: white; }
.btn-primary:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

/* ====== TABLES ====== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th {
    background: #f8fafc; padding: 11px 14px;
    text-align: left; font-size: 12px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
table td { padding: 12px 14px; border-bottom: 1px solid #f0f4f8; vertical-align: middle; }
table tr:hover td { background: #fafbfd; }
table tr:last-child td { border-bottom: none; }

/* ====== STATUS BADGES ====== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-registered { background: #dbeafe; color: #1d4ed8; }
.badge-submitted { background: #fef3c7; color: #92400e; }
.badge-progress { background: #ede9fe; color: #6d28d9; }
.badge-resolved { background: #dcfce7; color: #166534; }

/* ====== TRACKING TIMELINE ====== */
.timeline { position: relative; padding: 8px 0; }
.timeline::before {
    content: ''; position: absolute; left: 18px; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-left: 52px; margin-bottom: 20px; }
.timeline-dot {
    position: absolute; left: 10px; top: 4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--border); border: 3px solid white;
    box-shadow: 0 0 0 2px var(--border);
}
.timeline-dot.done { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.active { background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px;
}
.timeline-content h5 { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.timeline-content .meta { font-size: 12px; color: var(--text-muted); }

/* ====== FILTER BAR ====== */
.filter-bar {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 16px 20px;
    margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-bar .form-group { flex: 1; min-width: 150px; margin-bottom: 0; }

/* ====== TICKET/FORM PREVIEW ====== */
.ticket-form {
    max-width: 720px; margin: 0 auto;
    background: white; border: 2px solid var(--primary);
    border-radius: 12px; padding: 0; overflow: hidden;
    font-family: 'Inter', sans-serif;
}
.ticket-header {
    background: var(--primary); color: white;
    padding: 20px 28px; text-align: center;
}
.ticket-header h2 { font-family: 'Rajdhani', sans-serif; font-size: 22px; }
.ticket-header p { font-size: 12px; opacity: 0.8; }
.ticket-no-band {
    background: var(--accent); color: white;
    text-align: center; padding: 8px;
    font-size: 16px; font-weight: 700; letter-spacing: 2px;
}
.ticket-body { padding: 24px 28px; }
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.ticket-field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ticket-field p { font-size: 14px; font-weight: 600; margin-top: 2px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.ticket-footer {
    background: #f8fafc; padding: 16px 28px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-muted);
}

/* ====== ALERTS ====== */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ====== SEARCH BOX ====== */
.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ====== MODAL ====== */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: white; border-radius: var(--radius);
    width: 90%; max-width: 700px; max-height: 90vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-close { cursor: pointer; font-size: 20px; color: var(--text-muted); background: none; border: none; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; padding: 16px; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .complaint-types { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .ticket-grid { grid-template-columns: 1fr; }
}

/* ====== LOGIN PAGE ====== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #0f2744 50%, #1a3a5c 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: white; border-radius: 20px;
    width: 100%; max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}
.login-header {
    background: var(--primary); padding: 32px 28px; text-align: center;
}
.login-logo {
    width: 70px; height: 70px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: white; margin: 0 auto 14px;
    box-shadow: 0 4px 16px rgba(249,115,22,0.4);
}
.login-header h1 {
    font-family: 'Noto Sans Devanagari', sans-serif;
    color: white; font-size: 18px; font-weight: 700;
}
.login-header p { color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 4px; }
.login-body { padding: 28px; }
.login-body .form-group { margin-bottom: 16px; }
.login-body .btn { width: 100%; justify-content: center; }
.login-footer { text-align: center; padding: 16px 28px; background: #f8fafc; font-size: 12px; color: var(--text-muted); }

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .ticket-form { border: 1px solid #333; }
}
