/* ══════════════════════════════════════════════════════════════
   dashboard.css — Student Dashboard Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Dashboard Layout ────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 72px;
}

.dashboard-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border-glass);
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  padding: 28px 0;
  transition: transform 0.3s ease;
}
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

.dashboard-content {
  flex: 1;
  margin: 0 auto;
  padding: 40px 24px;
  max-width: 1000px;
  width: 100%;
}

/* ── Sidebar Navigation ──────────────────────────────────────── */
.sidebar-user {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 24px;
}

.sidebar-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.sidebar-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.sidebar-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 0 12px;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-bottom: 4px;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sidebar-link .link-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 16px 12px;
}

/* ── Dashboard Header ────────────────────────────────────────── */
.dashboard-header {
  margin-bottom: 36px;
}

.dashboard-greeting {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.dashboard-greeting span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Stats Row ───────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.stat-card-dashboard {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card-dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--gradient-accent));
  opacity: 0.8;
}

.stat-card-dashboard:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

.stat-card-dashboard.blue  { --stat-accent: linear-gradient(90deg, #3b82f6, #06b6d4); }
.stat-card-dashboard.amber { --stat-accent: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card-dashboard.purple { --stat-accent: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card-dashboard.green { --stat-accent: linear-gradient(90deg, #10b981, #34d399); }

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-card-icon {
  font-size: 1.4rem;
}

.stat-card-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

/* ── Dashboard Cards & Sections ──────────────────────────────── */
.dashboard-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── Order Table in Dashboard ────────────────────────────────── */
.orders-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-cyan);
}

.breadcrumb-sep {
  color: var(--border-glass);
}

.breadcrumb-current {
  color: var(--text-secondary);
}

/* ── Filter Tabs ─────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 6px;
  overflow-x: auto;
}

.filter-tab {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  border: none;
  background: none;
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.filter-tab.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ── Order Detail Card ───────────────────────────────────────── */
.order-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  align-items: start;
}

.order-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.order-info-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-id {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.order-tier-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.order-info-body {
  padding: 28px;
}

.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.order-meta-item label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.order-meta-item .meta-value {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.order-instructions {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Revision Quota ──────────────────────────────────────────── */
.revision-quota-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.revision-quota-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.revision-quota-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.revision-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.revision-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient-accent);
  transition: width 0.5s ease;
}

.revision-progress-bar.danger {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ── Revision History ────────────────────────────────────────── */
.revision-timeline {
  list-style: none;
  position: relative;
}

.revision-timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-glass);
}

.revision-item {
  position: relative;
  padding: 0 0 24px 44px;
}

.revision-dot {
  position: absolute;
  left: 9px;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.revision-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.revision-slide {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  font-weight: 600;
}

.revision-feedback {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Revision Form ───────────────────────────────────────────── */
.revision-form-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.revision-locked {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: #f87171;
}

.revision-locked-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Quick Actions ───────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Profile Card ────────────────────────────────────────────── */
.profile-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.35);
}

.profile-header-info h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.profile-university {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.profile-email {
  color: var(--accent-cyan);
  font-size: 0.9rem;
}

.profile-joined {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#sidebarOverlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ── Responsive Dashboard ────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    top: 0; /* Full height sidebar on mobile */
    background: var(--bg-secondary);
  }

  .sidebar-close-btn {
    display: block;
  }

  .dashboard-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.8);
  }

  .dashboard-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 16px;
  }

  .mobile-dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .profile-header-card {
    flex-direction: column;
    text-align: center;
    padding: 28px;
  }

  .order-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Past Orders — Mobile Card Layout ─────────────────────────── */
@media (max-width: 640px) {
  /* Hide the thead on mobile — labels come from data-label */
  .orders-table-wrapper .data-table thead {
    display: none;
  }

  /* Each row becomes a block card */
  .orders-table-wrapper .data-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin: 12px 14px;
    padding: 14px 16px;
    transition: background 0.2s;
  }

  .orders-table-wrapper .data-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
  }

  /* Remove per-cell bottom borders inside card */
  .orders-table-wrapper .data-table td {
    padding: 5px 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
  }

  /* Label badge before each cell value */
  .orders-table-wrapper .data-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Top row: order ID + status side by side */
  .orders-table-wrapper .data-table td.col-id {
    font-size: 0.82rem;
  }

  /* Action buttons fill width */
  .orders-table-wrapper .data-table td.col-action {
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 10px;
    justify-content: flex-end;
  }

  .orders-table-wrapper .data-table td.col-action::before {
    display: none;
  }

  /* Table itself: no border/bg — cards carry it */
  .orders-table-wrapper .data-table {
    background: none;
  }

  /* Wrapper: remove card border on mobile (cards have their own) */
  .orders-table-wrapper {
    background: none;
    border: none;
    border-radius: 0;
    overflow-x: visible;
  }
}
