@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Syne:wght@400..800&display=swap');

:root {
  /* Dark Mode (Default) Variables */
  --bg-color: #0A0A0A;
  --bg-surface: #111111;
  --bg-card: #1A1A1A;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --border-color: rgba(255, 255, 255, 0.08);

  /* Brand Colors */
  --primary-color: #FF4D00;
  --primary-glow: rgba(255, 77, 0, 0.4);
  --secondary-color: #FF8533;
  --accent-color: #f43f5e;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;

  /* Glassmorphism */
  --glass-bg: rgba(26, 26, 26, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);

  --bg-surface-light: rgba(255, 255, 255, 0.05);

  /* Skeletons */
  --skeleton-base: rgba(255, 255, 255, 0.05);
  --skeleton-shine: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-heading: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

[data-theme="light"] {
  /* Light Mode Variables */
  --bg-color: #F8F8F8;
  --bg-surface: #FFFFFF;
  --bg-card: #F0F0F0;
  --text-primary: #111111;
  --text-secondary: #666666;
  --border-color: rgba(0, 0, 0, 0.08);

  /* Glassmorphism adjustments for light mode */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);

  --bg-surface-light: rgba(0, 0, 0, 0.05);

  /* Skeletons adjustment */
  --skeleton-base: rgba(0, 0, 0, 0.05);
  --skeleton-shine: rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Glassmorphism Components */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

/* Header */
header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo svg {
  color: var(--primary-color);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  border: none;
  gap: 8px;
}

.btn:active {
  transform: translateY(2px);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--secondary-color);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  background: var(--bg-surface);
  transform: translateY(-2px);
}

/* Typography Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}

/* Dashboard Layout Structure */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  padding: 24px 16px;
  position: sticky;
  top: 80px;
  background-color: var(--bg-color);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
}

.sidebar-item:hover {
  background: var(--bg-surface);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

.sidebar-item.active {
  background: rgba(255, 77, 0, 0.12);
  color: #FF4D00;
  border-left: 3px solid #FF4D00;
  border-radius: 8px;
  /* Assuming we want to keep the radius, or user didn't mention it to be removed */
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
}

.main-content {
  padding: 40px 48px;
  max-width: 1200px;
}

/* User Card Component */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 0 16px 24px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.user-avatar,
.user-avatar-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
}

.user-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
  font-family: var(--font-body);
}

.user-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--bg-surface);
}

/* Stats Components */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

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

  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: var(--skeleton-base);
  background-image: linear-gradient(90deg,
      var(--skeleton-base) 0px,
      var(--skeleton-shine) 40px,
      var(--skeleton-base) 80px);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 8px;
}

.skeleton-text {
  height: 20px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-title {
  height: 32px;
  width: 40%;
  margin-bottom: 16px;
}

/* Global Utilities */
.loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 77, 0, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: auth-spin 1s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* Specific component tweaks */
.subject-card {
  padding: 28px;
  border-radius: 16px;
  border: 1px solid rgba(255, 77, 0, 0.15);
  transition: all 0.2s;
}

.subject-card:hover {
  border-color: rgba(255, 77, 0, 0.4);
  transform: translateY(-2px);
}

/* Added Missing Utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.min-h-screen {
  min-height: 100vh;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-google {
  background: white;
  color: #333;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group input,
.input-group select,
.input-group textarea {
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary-color);
}

.bg-surface-light {
  background: rgba(255, 255, 255, 0.05);
}

.auth-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.page-hidden .auth-loader {
  display: flex;
}