/* ============================================================
   Imam Addaniy College - Admission Portal Main CSS
   Theme: Green (#1a5c2e), Gold (#c9a227), White
   ============================================================ */

:root {
  --primary:        #1a5c2e;
  --primary-dark:   #0f3d1e;
  --primary-light:  #2d8a50;
  --secondary:      #c9a227;
  --secondary-dark: #a07d1a;
  --sidebar-width:  260px;
  --sidebar-col:    70px;
  --header-h:       60px;
  --shadow:         0 2px 10px rgba(0,0,0,.1);
  --radius:         .5rem;
  --trans:          all .3s ease;
}

/* ── BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f2f5; color: #333; overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ── BOOTSTRAP COLOR OVERRIDES ────────────────────── */
.bg-primary           { background-color: var(--primary)  !important; }
.text-primary         { color:            var(--primary)  !important; }
.border-primary       { border-color:     var(--primary)  !important; }
.btn-primary          { background-color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover    { background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }
.btn-outline-primary  { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-primary:hover { background-color: var(--primary) !important; color: #fff !important; }
.btn-warning          { background-color: var(--secondary) !important; border-color: var(--secondary) !important; color:#fff !important; }
.btn-warning:hover    { background-color: var(--secondary-dark) !important; }
.bg-warning           { background-color: var(--secondary) !important; }
.text-warning         { color: var(--secondary) !important; }
.navbar-dark.bg-primary { background-color: var(--primary) !important; }

/* ── HOMEPAGE ─────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #1a6b3a 100%);
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}
.stat-card { border-bottom: 3px solid var(--primary); transition: var(--trans); }
.stat-card:hover { transform: translateY(-2px); }
.requirements-list li { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 15px; }
.requirements-list li:last-child { border: none; }
.programme-card { transition: var(--trans); border-top: 3px solid transparent; }
.programme-card:hover { transform: translateY(-5px); border-top-color: var(--primary); box-shadow: 0 8px 25px rgba(0,0,0,.12) !important; }

/* ── DASHBOARD LAYOUT ─────────────────────────────── */
.dashboard-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--primary-dark);
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--trans);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-col); }

.sidebar-brand {
  padding: 16px 20px;
  background: rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
  border-bottom: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}
.sidebar-brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink:0; }
.sidebar-brand-text { color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; }
.sidebar-brand-text small { color: rgba(255,255,255,.6); font-weight: 400; display: block; font-size: 11px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.sidebar-section-title {
  color: rgba(255,255,255,.4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 20px 5px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  transition: var(--trans);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  font-size: 14px;
  cursor: pointer;
}
.nav-item-link:hover, .nav-item-link.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--secondary);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { background: var(--secondary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600; flex-shrink: 0; }

.sidebar-user {
  padding: 14px 20px;
  background: rgba(0,0,0,.15);
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px;
}
.sidebar-user-name  { color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role  { color: rgba(255,255,255,.5); font-size: 11px; text-transform: uppercase; }

/* Main content */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; transition: var(--trans); min-height: 100vh; }
.main-content.expanded { margin-left: var(--sidebar-col); }

/* Top Navbar */
.top-navbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 999;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sidebar-toggle-btn { background: none; border: none; color: #666; font-size: 18px; cursor: pointer; padding: 8px; border-radius: 6px; transition: var(--trans); }
.sidebar-toggle-btn:hover { background: #f0f0f0; color: var(--primary); }

.breadcrumb-nav .breadcrumb { margin: 0; font-size: 13px; }
.breadcrumb-nav .breadcrumb-item.active { color: #333; font-weight: 500; }

.top-nav-btn { background: none; border: none; color: #666; font-size: 16px; padding: 8px 10px; border-radius: 6px; position: relative; cursor: pointer; transition: var(--trans); }
.top-nav-btn:hover { background: #f0f2f5; color: var(--primary); }
.notification-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: #dc3545; border-radius: 50%; border: 2px solid #fff; }

.top-nav-profile { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; cursor: pointer; transition: var(--trans); border: none; background: none; }
.top-nav-profile:hover { background: #f0f2f5; }
.top-nav-profile-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.top-nav-profile-name  { font-size: 13px; font-weight: 600; color: #333; }

/* Page Content */
.page-content { padding: 24px; flex: 1; }
.page-title    { font-size: 22px; font-weight: 700; color: #1a1a2e; margin: 0 0 4px; }
.page-subtitle { color: #666; font-size: 14px; margin: 0; }
.page-header   { margin-bottom: 24px; }

/* ── CARDS ────────────────────────────────────────── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; font-weight: 600; color: #333; }

.stat-widget { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; transition: var(--trans); }
.stat-widget:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.stat-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 700; color: #1a1a2e; line-height: 1; }
.stat-label { font-size: 12px; color: #888; margin-top: 4px; font-weight: 500; }

/* ── TABLES ───────────────────────────────────────── */
.table thead th { background: #f8f9fa; color: #555; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border: none; padding: 12px 14px; }
.table tbody td { padding: 12px 14px; vertical-align: middle; font-size: 14px; border-color: #f0f0f0; }
.table tbody tr:hover { background: #f8fafe; }

/* ── FORMS ────────────────────────────────────────── */
.form-control, .form-select { border: 1.5px solid #e0e0e0; border-radius: 6px; padding: 10px 12px; font-size: 14px; transition: var(--trans); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,92,46,.1); }
.form-label { font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.required-star::after { content: ' *'; color: #dc3545; }

/* ── BADGES ───────────────────────────────────────── */
.badge { font-size: 11px; padding: 5px 10px; font-weight: 600; border-radius: 20px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 4px; }

/* ── AUTH PAGES ───────────────────────────────────── */
.auth-page { min-height: 100vh; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-circle { width: 72px; height: 72px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 28px; color: #fff; }
.auth-title    { font-size: 22px; font-weight: 700; color: #1a1a2e; text-align: center; margin-bottom: 4px; }
.auth-subtitle { color: #888; font-size: 13px; text-align: center; margin-bottom: 28px; }

/* ── TIMELINE ─────────────────────────────────────── */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: #e9ecef; }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #dee2e6; background: #dee2e6; }
.timeline-dot.active  { box-shadow: 0 0 0 2px var(--primary); background: var(--primary); }
.timeline-dot.success { box-shadow: 0 0 0 2px #28a745; background: #28a745; }
.timeline-dot.danger  { box-shadow: 0 0 0 2px #dc3545; background: #dc3545; }
.timeline-dot.warning { box-shadow: 0 0 0 2px #ffc107; background: #ffc107; }
.timeline-content { background: #f8f9fa; border-radius: 8px; padding: 10px 14px; }
.timeline-title { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 2px; }
.timeline-meta  { font-size: 11px; color: #888; }
.timeline-note  { font-size: 12px; color: #555; margin-top: 4px; }

/* ── UPLOAD ZONE ──────────────────────────────────── */
.upload-zone { border: 2px dashed #ccc; border-radius: 8px; padding: 24px; text-align: center; cursor: pointer; transition: var(--trans); background: #fafafa; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #f0f7f0; }
.upload-zone i { font-size: 32px; color: #aaa; margin-bottom: 8px; display: block; }

/* ── CHART ────────────────────────────────────────── */
.chart-container { position: relative; height: 260px; }

/* ── SPINNER ──────────────────────────────────────── */
.spinner-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.75); z-index: 9999; display: none; align-items: center; justify-content: center; }
.spinner-overlay.active { display: flex; }

/* ── DARK MODE ────────────────────────────────────── */
[data-theme="dark"] body      { background: #1a1d21; color: #d0d0d0; }
[data-theme="dark"] .card     { background: #242629; border-color: #2d3035; }
[data-theme="dark"] .card-header { background: #242629; border-color: #2d3035; color: #d0d0d0; }
[data-theme="dark"] .top-navbar { background: #1e2124; border-color: #2d3035; }
[data-theme="dark"] .table thead th  { background: #2d3035; color: #aaa; }
[data-theme="dark"] .table tbody tr:hover { background: #2a2d31; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: #2d3035; border-color: #404040; color: #d0d0d0; }
[data-theme="dark"] .stat-widget { background: #242629; }
[data-theme="dark"] .stat-value  { color: #f0f0f0; }
[data-theme="dark"] .main-content { background: #1a1d21; }
[data-theme="dark"] .page-title   { color: #f0f0f0; }
[data-theme="dark"] .bg-light     { background: #2d3035 !important; }
[data-theme="dark"] .text-muted   { color: #999 !important; }
[data-theme="dark"] .border       { border-color: #3a3d41 !important; }
[data-theme="dark"] .list-group-item { background: #242629; border-color: #3a3d41; color: #d0d0d0; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .stat-value { font-size: 20px; }
  .page-title { font-size: 18px; }
}

/* ── PRINT ────────────────────────────────────────── */
@media print {
  .sidebar, .top-navbar, .no-print, .btn { display: none !important; }
  .main-content { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
