/* ══════════════════════════════════════════════════════
   WST DESIGN TOKENS & STYLE GUIDE
   ══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand Colors */
  --wst-primary-blue:   #1877F2;
  --wst-primary-cyan:   #00BCD4;
  --wst-sage-teal:      #7DB6B1;
  --wst-dark-slate:     #37474F;
  --wst-cool-slate-1:   #475C66;
  --wst-cool-slate-2:   #5A707A;
  --wst-accent-purple:  #9900FF;

  /* Theme Surfaces (Light Mode) */
  --bg-app:             #F0F4F8;
  --bg-sidebar:         #37474F;
  --bg-surface:         rgba(255, 255, 255, 0.85);
  --bg-card:            #FFFFFF;
  --border-color:       rgba(125, 182, 177, 0.25);
  --border-glass:       rgba(255, 255, 255, 0.4);

  /* Typography */
  --text-primary:       #1E293B;
  --text-secondary:     #475C66;
  --text-muted:         #8E9AA0;
  --text-light:         #FFFFFF;

  /* Shadows & Radius */
  --shadow-sm:          0 2px 4px rgba(55, 71, 79, 0.05);
  --shadow-md:          0 4px 16px rgba(55, 71, 79, 0.08);
  --shadow-lg:          0 10px 25px rgba(55, 71, 79, 0.12);
  --shadow-glow:        0 0 15px rgba(0, 188, 212, 0.4);
  --radius-sm:          6px;
  --radius-md:          12px;
  --radius-lg:          18px;
  --radius-full:        9999px;

  /* Transitions */
  --transition-fast:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-app:             #12181E;
  --bg-sidebar:         #0E1318;
  --bg-surface:         rgba(30, 41, 51, 0.85);
  --bg-card:            #1E2933;
  --border-color:       rgba(125, 182, 177, 0.15);
  --border-glass:       rgba(255, 255, 255, 0.05);

  --text-primary:       #E2E8F0;
  --text-secondary:     #94A3B8;
  --text-muted:         #64748B;
  --text-light:         #FFFFFF;
  
  --shadow-md:          0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg:          0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ══════════════════════════════════════════════════════
   BASE & RESET
   ══════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--wst-sage-teal);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--wst-primary-cyan);
}

/* ══════════════════════════════════════════════════════
   LAYOUT STRATEGY
   ══════════════════════════════════════════════════════ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Desktop-First) */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transition: width var(--transition-normal);
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--wst-primary-cyan), var(--wst-accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, #FFF, var(--wst-sage-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--transition-fast);
}

.nav-item a:hover,
.nav-item.active a {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active a {
  border-left: 4px solid var(--wst-primary-cyan);
  background: linear-gradient(90deg, rgba(0, 188, 212, 0.15), transparent);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Dashboard Panel */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}

.top-bar {
  background-color: var(--bg-card);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal);
  flex-shrink: 0;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg-app);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background-color: var(--wst-sage-teal);
  color: white;
  transform: translateY(-2px);
}

.badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--wst-primary-cyan);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.avatar-wrapper {
  position: relative;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--wst-primary-cyan);
  object-fit: cover;
}

.user-status {
  width: 12px;
  height: 12px;
  background-color: #22C55E;
  border-radius: var(--radius-full);
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid var(--bg-card);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.content-body {
  padding: 2rem;
  flex: 1;
}

/* ══════════════════════════════════════════════════════
   VISUAL EXCELLENCE (Glassmorphism & Cards)
   ══════════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}

.gradient-card {
  background: linear-gradient(135deg, var(--wst-primary-blue), var(--wst-accent-purple));
  color: var(--text-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.gradient-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  transform: rotate(45deg);
}

/* Premium Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--wst-dark-slate);
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4 {
  color: #FFFFFF;
}

.page-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--wst-primary-blue), var(--wst-primary-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Forms & Fields */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--wst-primary-cyan);
  box-shadow: var(--shadow-glow);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2337474F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 1.2rem;
  padding-right: 3rem;
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2E8F0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--wst-primary-blue), var(--wst-primary-cyan));
  color: white;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(24, 119, 242, 0.4);
}

.btn-secondary {
  background-color: var(--bg-app);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--wst-sage-teal);
  color: white;
}

.btn-purple {
  background: linear-gradient(135deg, var(--wst-accent-purple), var(--wst-primary-cyan));
  color: white;
  box-shadow: 0 4px 12px rgba(153, 0, 255, 0.3);
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(153, 0, 255, 0.4);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.badge-pending {
  background-color: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-app) 25%, var(--border-color) 50%, var(--bg-app) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════
   COMPONENTS SPECIFIC STYLING
   ══════════════════════════════════════════════════════ */

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background-color: var(--bg-card);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
  border-left: 1px solid var(--border-color);
}

.cart-drawer.open {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-close {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.cart-close:hover {
  color: var(--wst-primary-cyan);
}

.cart-items {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-details {
  display: flex;
  flex-direction: column;
}

.cart-student {
  font-size: 0.75rem;
  color: var(--wst-primary-cyan);
  font-weight: 600;
}

.cart-course {
  font-weight: 500;
  font-size: 0.9rem;
}

.cart-price {
  font-weight: 700;
  color: var(--wst-primary-blue);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.15rem;
}

/* Responsive Grid Adjustments */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS
   ══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .sidebar {
    width: 70px;
    padding: 1rem 0.5rem;
  }
  
  .brand-name, 
  .sidebar-footer .btn span,
  .brand-section h2,
  .nav-item span {
    display: none;
  }
  
  .nav-item a {
    justify-content: center;
    padding: 0.85rem;
  }
  
  .brand-section {
    justify-content: center;
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  }

  .brand-section {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
  }

  .nav-menu {
    display: none; /* Desktop menu hidden on mobile */
  }

  .mobile-menu-toggle {
    display: block;
  }

  .top-bar {
    padding: 0 1.5rem;
  }

  .user-info {
    display: none;
  }

  .content-body {
    padding: 1.25rem;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  .cart-drawer {
    width: 100%;
    right: -100%;
  }
}

/* ══════════════════════════════════════════════════════
   PREMIUM TABLE STYLING
   ══════════════════════════════════════════════════════ */
.details-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.details-table th,
.details-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  transition: all var(--transition-fast);
}

.details-table th {
  background-color: var(--wst-dark-slate);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--wst-primary-cyan);
}

[data-theme="dark"] .details-table th {
  background-color: #17202A;
  color: var(--text-primary);
}

.details-table td {
  font-size: 0.95rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.details-table tbody tr:last-child td {
  border-bottom: none;
}

.details-table tbody tr {
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.details-table tbody tr:hover td {
  background-color: rgba(0, 188, 212, 0.05); /* Cyan tint */
  color: var(--wst-primary-blue);
}

[data-theme="dark"] .details-table tbody tr:hover td {
  background-color: rgba(0, 188, 212, 0.08);
}

