/* ============================================================================
   Ibn-e-Sina University (ISU) — Admissions Portal Modern Theme
   portal.css
   ============================================================================ */

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

:root {
  --isu-navy:        #07294d;
  --isu-navy-dark:   #041b33;
  --isu-navy-mid:    #0d3a6a;
  --isu-gold:        #c8a94a;
  --isu-gold-light:  #e2c46e;
  --isu-gold-pale:   #fdf3d8;
  --isu-teal:        #0e8f8f;
  --isu-teal-dark:   #0a6e6e;
  --isu-bg:          #f4f7fb;
  --isu-surface:     #ffffff;
  --isu-surface-2:   #f8fafe;
  --isu-text:        #2d3748;
  --isu-text-muted:  #718096;
  --isu-border:      #e2e8f0;
  --isu-radius:      12px;
  --isu-radius-sm:   8px;
  --isu-radius-lg:   18px;
  --isu-shadow-sm:   0 2px 8px rgba(7,41,77,0.06);
  --isu-shadow-md:   0 8px 24px rgba(7,41,77,0.10);
  --isu-shadow-lg:   0 18px 45px rgba(7,41,77,0.15);
  --font-family:     'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading:    'Playfair Display', Georgia, serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--isu-bg);
  color: var(--isu-text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

/* ── Typography & Links ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--isu-navy);
  font-weight: 700;
}
a {
  color: var(--isu-navy-mid);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--isu-gold);
}

/* ── Top Utility Bar ── */
.portal-topbar {
  background: var(--isu-navy-dark);
  color: #d1d5db;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.portal-topbar a {
  color: #e5e7eb;
}
.portal-topbar a:hover {
  color: var(--isu-gold-light);
}

/* ── Main Navigation Header ── */
.portal-navbar {
  background: #ffffff;
  box-shadow: var(--isu-shadow-sm);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.portal-brand img.logo {
  height: 52px;
  width: auto;
}
.portal-brand .brand-text {
  display: flex;
  flex-direction: column;
}
.portal-brand .univ-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--isu-navy);
  line-height: 1.2;
}
.portal-brand .portal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--isu-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Split Layout for Login & Register ── */
.auth-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 15px;
}
.auth-card {
  background: #ffffff;
  border-radius: var(--isu-radius-lg);
  box-shadow: var(--isu-shadow-lg);
  overflow: hidden;
  max-width: 1050px;
  width: 100%;
  display: flex;
  border: 1px solid var(--isu-border);
}
.auth-sidebar {
  background: linear-gradient(145deg, var(--isu-navy-dark) 0%, var(--isu-navy-mid) 50%, #084875 100%);
  color: #ffffff;
  padding: 45px 35px;
  width: 42%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.auth-sidebar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(200,169,74,0.18) 0%, rgba(200,169,74,0) 70%);
  pointer-events: none;
}
.auth-main {
  padding: 45px 40px;
  width: 58%;
  background: #ffffff;
}

@media (max-width: 991px) {
  .auth-card { 
    flex-direction: column; 
    border-radius: var(--isu-radius);
    max-width: 650px;
  }
  .auth-sidebar, .auth-main { 
    width: 100%; 
  }
  .auth-sidebar {
    padding: 30px 24px;
  }
  .auth-main {
    padding: 30px 24px;
  }
}

@media (max-width: 575px) {
  .auth-wrapper {
    padding: 16px 10px;
    min-height: auto;
  }
  .auth-sidebar {
    padding: 22px 16px;
  }
  .auth-main {
    padding: 24px 16px;
  }
}

/* ── Forms & Controls ── */
.form-label {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--isu-navy);
  margin-bottom: 6px;
}
.form-control, .form-select {
  border-radius: var(--isu-radius-sm);
  border: 1.5px solid var(--isu-border);
  padding: 10px 14px;
  font-size: 14.5px;
  transition: all 0.2s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--isu-navy-mid);
  box-shadow: 0 0 0 3px rgba(13,58,106,0.12);
}

/* iOS Safari font zoom fix & comfortable touch targets */
@media (max-width: 767px) {
  .form-control, .form-select {
    font-size: 16px !important;
    min-height: 44px;
  }
  .btn-isu, .btn-isu-gold {
    min-height: 44px;
    font-size: 15px;
  }
}

/* ── Primary Buttons ── */
.btn-isu {
  background: linear-gradient(135deg, var(--isu-navy) 0%, var(--isu-navy-mid) 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--isu-radius-sm);
  border: none;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-isu:hover {
  background: linear-gradient(135deg, var(--isu-navy-mid) 0%, var(--isu-navy-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(7,41,77,0.25);
  transform: translateY(-1px);
}
.btn-isu-gold {
  background: linear-gradient(135deg, var(--isu-gold) 0%, #b39235 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--isu-radius-sm);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}
.btn-isu-gold:hover {
  background: linear-gradient(135deg, #b39235 0%, #997825 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(200,169,74,0.3);
  transform: translateY(-1px);
}

/* ── Dashboard & Student Portal Layout ── */
.portal-layout {
  display: flex;
  min-height: calc(100vh - 120px);
}

@media (min-width: 992px) {
  .portal-sidebar,
  .portal-sidebar.offcanvas-lg {
    width: 270px !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-right: 1px solid var(--isu-border);
    padding: 24px 16px;
    flex-shrink: 0;
  }
  .portal-content {
    flex-grow: 1;
    padding: 30px;
    background: var(--isu-bg);
    min-width: 0;
  }
}

@media (max-width: 991px) {
  .portal-layout {
    flex-direction: column;
  }
  .portal-sidebar.offcanvas-lg {
    max-width: 320px;
    width: 85%;
    background-color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: var(--isu-shadow-lg);
    z-index: 1045;
  }
  .portal-sidebar .offcanvas-header {
    background: linear-gradient(135deg, var(--isu-navy-dark) 0%, var(--isu-navy-mid) 100%);
    color: #ffffff;
  }
  .portal-sidebar .offcanvas-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
  }
  .portal-sidebar .offcanvas-body {
    padding: 18px;
  }
  .portal-content {
    flex-grow: 1;
    padding: 18px 12px;
    background: var(--isu-bg);
    min-width: 0;
  }
}

/* ── Sidebar Nav ── */
.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--isu-radius-sm);
  color: #4a5568;
  font-weight: 500;
  font-size: 14.5px;
  margin-bottom: 5px;
  transition: all 0.2s ease;
}
.portal-nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #718096;
}
.portal-nav-link:hover {
  background: var(--isu-surface-2);
  color: var(--isu-navy);
}
.portal-nav-link:hover i {
  color: var(--isu-gold);
}
.portal-nav-link.active {
  background: linear-gradient(135deg, rgba(7,41,77,0.08) 0%, rgba(13,58,106,0.12) 100%);
  color: var(--isu-navy);
  font-weight: 700;
  border-left: 4px solid var(--isu-navy);
}
.portal-nav-link.active i {
  color: var(--isu-navy);
}

/* ── Cards & Panels ── */
.portal-card {
  background: #ffffff;
  border-radius: var(--isu-radius);
  border: 1px solid var(--isu-border);
  box-shadow: var(--isu-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}
.portal-card-header {
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--isu-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-card-header h5 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--isu-navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-card-body {
  padding: 24px;
}

/* ── Progress Tracker ── */
.stepper-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px 2px;
  margin-bottom: 15px;
}
.stepper-wrapper::-webkit-scrollbar {
  height: 4px;
}
.stepper-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.progress-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  position: relative;
}
@media (max-width: 767px) {
  .progress-stepper {
    min-width: 520px;
    margin-bottom: 5px;
  }
  .step-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .step-label {
    font-size: 11px;
  }
  .step-item::before {
    top: 16px;
  }
}
.step-item {
  flex: 1;
  text-align: center;
  position: relative;
}
.step-item::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}
.step-item:first-child::before {
  display: none;
}
.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #718096;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}
.step-item.completed .step-icon {
  background: #10b981;
  color: #ffffff;
}
.step-item.active .step-icon {
  background: var(--isu-navy);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(7,41,77,0.18);
}
.step-item.completed::before {
  background: #10b981;
}
.step-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 6px;
  color: #718096;
}
.step-item.active .step-label {
  color: var(--isu-navy);
}
.step-item.completed .step-label {
  color: #059669;
}

/* ── Program Selection Cards ── */
.program-card {
  border: 2px solid var(--isu-border);
  border-radius: var(--isu-radius);
  padding: 20px;
  background: #ffffff;
  transition: all 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.program-card:hover {
  border-color: var(--isu-gold);
  box-shadow: var(--isu-shadow-md);
  transform: translateY(-2px);
}
.program-card.selected {
  border-color: var(--isu-navy);
  background: rgba(7,41,77,0.02);
}
.program-badge {
  background: var(--isu-gold-pale);
  color: #8c6e1c;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}

/* ── Document Upload Box ── */
.upload-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--isu-radius);
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}
.upload-box:hover {
  border-color: var(--isu-navy-mid);
  background: #f1f5f9;
}

/* ── Bank Challan Sheet (Print-ready & Mobile Responsive) ── */
.challan-container {
  display: flex;
  background: #ffffff;
  padding: 20px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  border-radius: var(--isu-radius-sm);
}
.challan-copy {
  flex: 1;
  padding: 15px;
  border-right: 1px dashed #94a3b8;
}
.challan-copy:last-child {
  border-right: none;
}
.challan-header {
  text-align: center;
  border-bottom: 1.5px solid #07294d;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.challan-header h6 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  color: #07294d;
}
.challan-table {
  width: 100%;
  margin-bottom: 10px;
  font-size: 11.5px;
}
.challan-table td {
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
}
.challan-table th {
  background: #f1f5f9;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

/* Challan Mobile Screen Stacking (< 992px) */
@media (max-width: 991px) {
  .challan-container {
    flex-direction: column;
    padding: 12px;
  }
  .challan-copy {
    border-right: none;
    border-bottom: 2px dashed #94a3b8;
    padding: 18px 4px;
  }
  .challan-copy:last-child {
    border-bottom: none;
  }
}

/* Challan Landscape Print Mode (always 3 columns across paper) */
@media print {
  body * { visibility: hidden; }
  .challan-container, .challan-container * { visibility: visible; }
  .challan-container { 
    position: absolute; 
    left: 0; 
    top: 0; 
    width: 100%; 
    border: none; 
    display: flex !important; 
    flex-direction: row !important; 
    padding: 0 !important;
  }
  .challan-copy {
    flex: 1 !important;
    border-right: 1px dashed #94a3b8 !important;
    border-bottom: none !important;
    padding: 10px !important;
  }
  .challan-copy:last-child {
    border-right: none !important;
  }
  .no-print { display: none !important; }
}

/* ── Admin Directorate Sidebar & High-Contrast Typography ── */
.admin-sidebar,
.admin-sidebar.offcanvas-lg,
div.admin-sidebar {
  background-color: #07294d !important;
  background: #07294d !important;
  color: #ffffff !important;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .admin-sidebar,
  .admin-sidebar.offcanvas-lg,
  div.admin-sidebar {
    width: 260px !important;
    min-height: 100vh !important;
    background-color: #07294d !important;
    background: #07294d !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.18);
  }
}

@media (max-width: 991px) {
  .admin-sidebar.offcanvas-lg {
    max-width: 290px;
    width: 85%;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    background-color: #07294d !important;
    background: #07294d !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
  }
  .admin-content {
    padding: 14px 10px;
    width: 100%;
  }
  .admin-topbar {
    padding: 10px 14px;
  }
}

.admin-sidebar a {
  color: #ffffff !important;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 8px;
  margin: 3px 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.admin-sidebar a:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  transform: translateX(3px);
}

.admin-sidebar a.active {
  background: rgba(200, 169, 74, 0.25) !important;
  color: #ffffff !important;
  font-weight: 700;
  border-left: 4px solid var(--isu-gold) !important;
}

.admin-sidebar i {
  width: 22px;
  text-align: center;
  font-size: 16px;
}

.admin-nav-heading {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  color: #ffd700 !important; /* Vivid Gold for high contrast */
  padding: 14px 16px 4px 16px;
  display: block;
}

.admin-content {
  flex-grow: 1;
  background: #f1f5f9;
  min-height: 100vh;
  padding: 25px;
  min-width: 0;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 25px;
}

/* ── General Mobile Polish Helpers ── */
@media (max-width: 575px) {
  .portal-card-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .portal-card-body {
    padding: 16px;
  }
  .portal-brand img.logo {
    height: 40px;
  }
  .portal-brand .univ-name {
    font-size: 16px;
  }
  .portal-brand .portal-title {
    font-size: 11px;
  }
  .table > :not(caption) > * > * {
    padding: 0.5rem 0.5rem;
  }
}
