/* ============================================================
   FYP PORTAL — Design Tokens & Base Styles
   Aligned with Internship Portal (DIMS) design system
   Colors: Primary #1E3A8A, Secondary #2563EB, BG #EFF6FF
   Font: Poppins (same as DIMS)
   Inspired by Claude AI's minimal, clean UI principles
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* === Brand Colors (matching Internship Portal exactly) === */
  --color-primary: #1E3A8A;
  --color-primary-dark: #1e40af;
  --color-primary-hover: #1e2f6e;
  --color-secondary: #2563EB;
  --color-secondary-hover: #1d4ed8;
  --color-lightbg: #EFF6FF;
  --color-success: #059669;
  --color-warning: #D97706;
  --color-danger: #DC2626;
  --color-pending: #B45309;
  --color-info: #0ea5e9;

  /* === Semantic Surface Colors === */
  --color-surface: #ffffff;
  --color-surface-hover: #f8faff;
  --color-surface-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-border-blue: #dbeafe;

  /* === Text Colors === */
  --color-text: #111827;
  --color-text-secondary: #374151;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-text-placeholder: #d1d5db;

  /* === Status Chip Colors === */
  --chip-success-bg: #ecfdf5;
  --chip-success-text: #065f46;
  --chip-warning-bg: #fffbeb;
  --chip-warning-text: #92400e;
  --chip-danger-bg: #fef2f2;
  --chip-danger-text: #991b1b;
  --chip-info-bg: #eff6ff;
  --chip-info-text: #1e40af;
  --chip-gray-bg: #f9fafb;
  --chip-gray-text: #374151;

  /* === Typography === */
  --font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-size-xs: 0.7rem;      /* 11.2px */
  --font-size-sm: 0.8125rem;   /* 13px */
  --font-size-base: 0.9375rem; /* 15px */
  --font-size-md: 1rem;        /* 16px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */
  --font-size-6xl: 3.75rem;    /* 60px */

  /* === Spacing Scale === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* === Border Radii === */
  --radius-sm: 0.5rem;    /* 8px */
  --radius-md: 0.75rem;   /* 12px */
  --radius-lg: 1rem;      /* 16px */
  --radius-xl: 1.25rem;   /* 20px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-3xl: 2rem;     /* 32px */
  --radius-4xl: 2.5rem;   /* 40px */
  --radius-full: 9999px;

  /* === Shadows === */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12);
  --shadow-primary: 0 8px 24px rgba(30,58,138,0.18);
  --shadow-primary-lg: 0 16px 48px rgba(30,58,138,0.22);

  /* === Transitions === */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* === Sidebar === */
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 68px;

  /* === Topbar === */
  --topbar-height: 64px;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--color-lightbg);
  color: var(--color-text-secondary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.sidebar-nav { scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }

/* ── Container ─────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
}

/* ── Typography ────────────────────────── */
.section-label {
  font-size: var(--font-size-xs);
  font-weight: 800;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin-bottom: var(--space-3);
}

.section-label-light {
  font-size: var(--font-size-xs);
  font-weight: 800;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.18;
  margin-bottom: var(--space-5);
}

.section-title-light {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.18;
  margin-bottom: var(--space-5);
}

.section-desc {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-8);
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-xl);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
}

.btn:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,0.4); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-primary-lg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
}
.btn-secondary:hover {
  background: var(--color-secondary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.btn-secondary-outline {
  background: transparent;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}
.btn-secondary-outline:hover {
  background: var(--color-surface-alt);
}

.btn-ghost {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.2); }

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-lg);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: var(--font-size-base);
  border-radius: var(--radius-xl);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--color-lightbg);
  color: var(--color-primary);
  border-color: var(--color-border-blue);
}

.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }

/* ── Form Elements ──────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px white inset;
  -webkit-text-fill-color: var(--color-text);
}

.form-input::placeholder { color: var(--color-text-placeholder); }
.form-textarea { resize: vertical; min-height: 100px; }

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  font-size: 0.875rem;
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 2.5rem;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-blue);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1.5px solid var(--color-border-light);
}

.card-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
}

.card-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* ── Status Chips ───────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-success { background: var(--chip-success-bg); color: var(--chip-success-text); }
.chip-success .chip-dot { background: var(--color-success); }
.chip-warning { background: var(--chip-warning-bg); color: var(--chip-warning-text); }
.chip-warning .chip-dot { background: var(--color-warning); }
.chip-danger { background: var(--chip-danger-bg); color: var(--chip-danger-text); }
.chip-danger .chip-dot { background: var(--color-danger); }
.chip-info { background: var(--chip-info-bg); color: var(--chip-info-text); }
.chip-info .chip-dot { background: var(--color-secondary); }
.chip-gray { background: var(--chip-gray-bg); color: var(--chip-gray-text); }
.chip-gray .chip-dot { background: var(--color-text-faint); }

/* ── Table ─────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 0.75rem 1rem;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1.5px solid var(--color-border);
  background: var(--color-surface-alt);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-lightbg); }
.table .td-primary { font-weight: 600; color: var(--color-text); }
.table .td-muted { color: var(--color-text-faint); font-size: var(--font-size-xs); }

/* ── Utility ────────────────────────────── */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-emerald { color: #059669; }
.text-amber { color: #d97706; }
.text-rose { color: #f43f5e; }
.text-muted { color: var(--color-text-muted); }

.bg-white { background: white; }
.border-y-light { border-top: 1px solid var(--color-border-blue); border-bottom: 1px solid var(--color-border-blue); }

.section { padding: var(--space-24) 0; }

.text-center { text-align: center; }
.mb-16 { margin-bottom: var(--space-16); }

/* ── Animations ─────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInFast {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.7s ease-out forwards; }
.animate-fade-in-delay-1 { animation: fadeIn 0.7s ease-out 0.1s both; }
.animate-fade-in-delay-2 { animation: fadeIn 0.7s ease-out 0.2s both; }
.animate-fade-in-delay-3 { animation: fadeIn 0.7s ease-out 0.3s both; }
.animate-scale-in { animation: scaleIn 0.25s ease-out forwards; }

.skeleton {
  background: linear-gradient(90deg, #f0f4ff 25%, #e8eeff 50%, #f0f4ff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}

/* ── Responsive Breakpoints ─────────────── */
@media (max-width: 1024px) {
  .section { padding: var(--space-20) 0; }
}

@media (max-width: 768px) {
  .section { padding: var(--space-16) 0; }
}

@media (max-width: 640px) {
  .section { padding: var(--space-12) 0; }
  .btn-lg { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
}
