@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --secondary-hover: #4f46e5;
  --accent: #f43f5e;
  
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --border-color: #e2e8f0;

  --success: #10b981;
  --error: #ef4444;

  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.08);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  color: #1e293b;
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.85rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 500;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Premium Glassmorphism */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 2rem;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.003);
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  color: #334155;
  letter-spacing: 0.01em;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-family);
  font-size: 1rem;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0.5rem;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  box-shadow: 0 6px 16px -4px var(--primary);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -4px var(--primary);
  filter: brightness(1.08);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-fade-in, .fade-in {
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Background overlay */
.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  background-color: rgba(15, 23, 42, 0.62);
}

/* Body: background image for citizen/login pages */
body {
  font-family: var(--font-family);
  background: url('../../images/bcbldg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ============================================================
   CITIZEN DASHBOARD LAYOUT  (matches Node.js UserLayout)
   ============================================================ */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .dashboard-layout {
    flex-direction: row;
    padding: 2rem;
  }
}

/* Citizen Sidebar */
.sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: 2rem;
}

@media (min-width: 768px) {
  .sidebar {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    min-height: calc(100vh - 4rem);
    position: sticky;
    top: 2rem;
    align-self: flex-start;
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
}

/* Citizen main content area */
.dashboard-content {
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* ============================================================
   ADMIN LAYOUT  (matches Node.js AdminLayout – fixed, white bg)
   ============================================================ */
body.admin-body-page {
  background: radial-gradient(at 0% 0%, rgba(14,131,181,0.15) 0px, transparent 50%),
              radial-gradient(at 100% 0%, rgba(156,219,240,0.20) 0px, transparent 50%),
              #f8fafc;
  background-attachment: initial;
}

.admin-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  z-index: 100;
  background: radial-gradient(at 0% 0%, rgba(14,131,181,0.15) 0px, transparent 50%),
              radial-gradient(at 100% 0%, rgba(156,219,240,0.20) 0px, transparent 50%),
              #f8fafc;
  display: flex;
  flex-direction: column;
}

.admin-header {
  height: 60px;
  background-color: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  z-index: 10;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.admin-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background-color: #0e83b5;
  color: white;
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
  border-left: 3px solid transparent;
  position: relative;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background-color: rgba(0,0,0,0.12);
  border-left-color: #ffffff;
  color: white !important;
}

.admin-nav-link i {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.admin-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* ============================================================
   ADMIN STAT CARDS
   ============================================================ */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex: 1;
  min-width: 160px;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%; width: 4px;
}

.stat-card-blue::before  { background: #3b82f6; }
.stat-card-red::before   { background: #ef4444; }
.stat-card-yellow::before{ background: #eab308; }
.stat-card-green::before { background: #10b981; }

.stat-card-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.stat-card-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

/* ============================================================
   ADMIN TABLE
   ============================================================ */
.admin-table-wrapper {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.admin-table-header {
  background-color: #0e83b5;
  color: white;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #f8fafc;
  color: #374151;
  padding: 0.7rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: 0.875rem;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

/* ============================================================
   ADMIN FILTER ROW
   ============================================================ */
.admin-filter-row {
  background: white;
  padding: 1rem;
  border-radius: 0.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  flex-wrap: wrap;
}

.admin-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}

.admin-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-filter-input {
  padding: 0.45rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  color: #1e293b;
  background: white;
  font-family: var(--font-family);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.badge-warning  { background: #eab308; }
.badge-success  { background: #10b981; }
.badge-primary  { background: #3b82f6; }
.badge-info     { background: #6366f1; }
.badge-danger   { background: #ef4444; }
.badge-secondary{ background: #94a3b8; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.flex        { display: flex; }
.grid        { display: grid; }
.gap-4       { gap: 1rem; }
.gap-6       { gap: 1.5rem; }
.justify-between { justify-content: space-between; }
.align-center    { align-items: center; }
.items-center    { align-items: center; }
.flex-wrap   { flex-wrap: wrap; }
.py-2        { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.mb-0        { margin-bottom: 0; }
.mb-4        { margin-bottom: 1rem; }
.mb-6        { margin-bottom: 1.5rem; }
.mb-8        { margin-bottom: 2rem; }
.mb-10       { margin-bottom: 2.5rem; }
.mt-4        { margin-top: 1rem; }
.mt-6        { margin-top: 1.5rem; }
.mt-auto     { margin-top: auto; }
.relative    { position: relative; }
.z-10        { z-index: 10; }

/* ============================================================
   RESPONSIVE ADMIN
   ============================================================ */
@media (max-width: 768px) {
  .admin-title { display: none; }
  
  .admin-body { flex-direction: column; }
  
  .admin-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
  }
  
  .admin-nav-link {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }
  
  .admin-nav-link:hover,
  .admin-nav-link.active {
    border-left: none;
    border-bottom-color: white;
  }
  
  .admin-content { padding: 1rem; }
}
