/* ==========================================================================
   Somaya Eduwings - Core Design System & Layouts
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Warm Orange & Espresso Modern Palette */
  --bg-main: #141210;
  --bg-surface: #1e1a17;
  --bg-surface-elevated: #2c2621;
  --bg-glass: rgba(30, 26, 23, 0.92);
  --border-color: #38302a;
  --border-highlight: #52463d;

  --text-primary: #faf6f2;
  --text-secondary: #d4ccc5;
  --text-muted: #9c9187;

  /* Primary Brand: Vibrant Warm Orange */
  --brand-primary: #ea580c;
  --brand-primary-hover: #c2410c;
  --brand-gradient: #ea580c;
  --brand-accent: #f97316;

  /* Status Accents */
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.14);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.14);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.14);
  --info: #ea580c;
  --info-bg: rgba(234, 88, 12, 0.14);

  /* Natural, directional shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --glow: none;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bottom-nav-height: 64px;
  --header-height: 64px;
  --sidebar-width: 250px;
}

[data-theme="light"] {
  --bg-main: #faf7f5;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f4ede8;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --border-color: #e8ded7;
  --border-highlight: #d8c8bf;

  --text-primary: #1c1815;
  --text-secondary: #52473f;
  --text-muted: #82756b;

  --shadow-sm: 0 1px 2px rgba(28, 24, 21, 0.05);
  --shadow-md: 0 4px 12px rgba(28, 24, 21, 0.06);
  --shadow-lg: 0 12px 24px rgba(28, 24, 21, 0.08);
  --glow: none;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

/* ==========================================================================
   Background Aesthetics
   ========================================================================== */

.app-background-blobs {
  display: none;
}

/* ==========================================================================
   Authentication Screen Layout
   ========================================================================== */

.auth-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.25rem 2rem;
  animation: fadeInAuth 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInAuth {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-badge-logo {
  width: 54px;
  height: 54px;
  background: var(--brand-primary);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 0.85rem;
}

.auth-brand h1 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.brand-gradient-text {
  color: var(--brand-primary);
}

.auth-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Demo Role Picker Chips */
.demo-role-section {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.5rem;
}

.demo-role-section span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.role-chip-group {
  display: flex;
  gap: 0.5rem;
}

.role-chip {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.role-chip:hover, .role-chip.active-role-chip {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.input-icon-wrapper .btn-input-action {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  z-index: 2;
  transition: color 0.2s ease;
}

.input-icon-wrapper .btn-input-action:hover {
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.input-icon-wrapper .form-control {
  padding-right: 2.75rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: var(--bg-surface);
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-link {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-primary {
  width: 100%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: translateY(1px);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Main Application App Layout (Post Login)
   ========================================================================== */

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* Sidebar for Desktop */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  width: 38px;
  height: 38px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-text h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.logo-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 0.2rem;
}

.nav-link svg {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-link:hover svg {
  color: var(--brand-primary);
}

.nav-link.active {
  background: var(--brand-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.nav-link.active svg {
  color: white;
}

.sidebar-user-section {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-mini-card img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-primary);
}

.user-mini-info {
  flex: 1;
  min-width: 0;
}

.user-mini-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.app-main {
  flex: 1;
  margin-left: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  background: rgba(30, 26, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.9);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--brand-primary);
}

.header-search {
  position: relative;
  width: 280px;
}

.header-search input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 2.3rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.header-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-scroll-content {
  flex: 1;
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Tab Panes */
.tab-pane-content {
  display: none;
  animation: fadeInPane 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pane-content.active-pane {
  display: block;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Mobile Navigation Bar (Appears on Mobile)
   ========================================================================== */

/* =========================
   COLLEGE STATUS
========================= */

.college-card {
  position: relative;
}

/* Clean neutral card border default */
.college-card.college-active,
.college-card.college-inactive {
  border-color: var(--border-color);
  opacity: 1;
}

/* Status - Top Right */
.college-status-indicator {
  position: absolute;
  top: 16px;
  right: 16px;

  display: flex;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 5;
}

/* Status Dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ACTIVE */
.college-active .college-status-indicator {
  color: #4ade80;
}

.college-active .status-dot {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

/* INACTIVE */
.college-inactive .college-status-indicator {
  color: #f87171;
}

.college-inactive .status-dot {
  background: #f87171;
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.7);
}

/* ==========================================================================
   Responsive Breakpoints (Mobile First)
   ========================================================================== */

@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .app-main {
    margin-left: 0;
    padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .btn-mobile-toggle {
    display: flex !important;
  }

  .header-search {
    display: none;
  }
}

/*@media (max-width: 640px) {*/
/*  .main-scroll-content {*/
/*    padding: 1rem;*/
/*  }*/

/*  .app-header {*/
/*    padding: 0 1rem;*/
/*  }*/

/*  .auth-container {*/
/*    padding: 1.75rem 1.25rem;*/
/*  }*/

/*  .role-chip-group {*/
/*    flex-direction: column;*/
/*  }*/
/*}*/

@media (max-width: 640px) {
  .main-scroll-content {
    padding: 1rem !important;
  }

  .app-header {
    padding: 0 0.85rem;
    height: 56px;
  }

  .app-header .logo-text span {
    display: none !important; /* Hide long subtitle on mobile so header fits 320px */
  }

  .app-header .logo-text h2 {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .app-header .logo-badge {
    width: 32px;
    height: 32px;
  }
}

/* =========================================================
   MANDATE DATATABLE - THEME AWARE
========================================================= */

.mandate-table-wrapper {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* DataTables main wrapper */
#mandateTable_wrapper {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 1rem;
}

/* Top controls */
#mandateTable_wrapper .dt-length,
#mandateTable_wrapper .dt-search {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Search input */
#mandateTable_wrapper .dt-search input {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.65rem;
    outline: none;
}

#mandateTable_wrapper .dt-search input:focus {
    border-color: var(--brand-primary);
}

/* Entries select */
#mandateTable_wrapper .dt-length select {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    outline: none;
}

/* Table */
#mandateTable {
    width: 100% !important;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-collapse: collapse !important;
}

/* Table Header */
#mandateTable thead th {
    background: var(--bg-surface-elevated) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.8rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Table Body */
#mandateTable tbody td {
    background: var(--bg-surface) !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.85rem 0.9rem;
    font-size: 0.78rem;
}

/* Hover */
#mandateTable tbody tr:hover td {
    background: var(--bg-surface-elevated) !important;
}

/* Student name */
#mandateTable .student-info strong {
    color: var(--text-primary);
}

#mandateTable .student-info span {
    color: var(--text-muted);
}

/* Bottom info */
#mandateTable_wrapper .dt-info {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Pagination */
#mandateTable_wrapper .dt-paging button {
    background: var(--bg-surface-elevated) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm);
}

#mandateTable_wrapper .dt-paging button:hover {
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--brand-primary) !important;
}

#mandateTable_wrapper .dt-paging button.current {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border-color: var(--brand-primary) !important;
}

/* Disabled pagination */
#mandateTable_wrapper .dt-paging button.disabled {
    opacity: 0.4;
}

/* Status badges */
.status-pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-approved {
    background: var(--success-bg);
    color: var(--success);
}

.status-rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Action buttons */
.approve-btn {
    background: var(--success-bg);
    color: var(--success);
}

.approve-btn:hover {
    background: var(--success);
    color: #fff;
}

.reject-btn {
    background: var(--danger-bg);
    color: var(--danger);
}

.reject-btn:hover {
    background: var(--danger);
    color: #fff;
}