@tailwind base;
@tailwind components;
@tailwind utilities;

/* Modern Student Dashboard Design System - Inspired by Lecture UI */

:root {
  /* Background Colors */
  --bg-page: #F6F7F9;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  
  /* Primary Accent - Reddish Orange */
  --primary-accent: #E94B5E;
  --primary-accent-light: #FEF2F2;
  --primary-accent-hover: #D43A4D;
  
  /* Subject Colors */
  --color-green: #5FC88B;
  --color-yellow: #FDD96E;
  --color-purple: #8A70FF;
  --color-blue: #5B9BD5;
  --color-red: #E94B5E;
  --color-orange: #FFA366;
  
  /* Text Colors */
  --text-primary: #1A202C;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-light: #CBD5E0;
  
  /* Borders & Dividers */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  margin: 0;
}

/* Card Styles */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-sm {
  padding: var(--spacing-md);
}

.card-lg {
  padding: var(--spacing-xl);
}

/* Sidebar Navigation */
.sidebar {
  background: linear-gradient(180deg, #1A202C 0%, #2D3748 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  min-height: calc(100vh - 2rem);
  margin: var(--spacing-md);
}

.sidebar-header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: var(--spacing-xs);
}

.sidebar-subtitle {
  font-size: 0.875rem;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-xs) 0;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background-color: rgba(233, 75, 94, 0.1);
  color: white;
}

.nav-item.active {
  background-color: rgba(233, 75, 94, 0.2);
  color: white;
  border-left-color: var(--primary-accent);
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.nav-section-divider {
  margin: var(--spacing-lg) 0;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-section-divider > div {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Search Bar */
.search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  max-width: 400px;
}

.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

/* Class Cards */
.class-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.class-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.class-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--spacing-md);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.class-icon.green { background-color: var(--color-green); }
.class-icon.yellow { background-color: var(--color-yellow); }
.class-icon.purple { background-color: var(--color-purple); }
.class-icon.blue { background-color: var(--color-blue); }

.class-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.class-status {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.class-button {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.class-button:hover {
  background: var(--primary-accent-light);
  border-color: var(--primary-accent);
  color: var(--primary-accent);
}

/* Task List Items */
.task-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.task-item:hover {
  box-shadow: var(--shadow-md);
}

.task-indicator {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.task-indicator.green { background-color: var(--color-green); }
.task-indicator.yellow { background-color: var(--color-yellow); }
.task-indicator.purple { background-color: var(--color-purple); }
.task-indicator.blue { background-color: var(--color-blue); }

.task-content {
  flex: 1;
}

.task-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.task-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.task-tag {
  display: inline-block;
  background: var(--bg-page);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  margin-left: var(--spacing-xs);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.btn-primary {
  background: var(--primary-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-accent-hover);
}

.btn-secondary {
  background: var(--bg-page);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-medium);
}

/* Calendar */
.calendar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.calendar-month {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-nav {
  display: flex;
  gap: var(--spacing-sm);
}

.calendar-nav button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.calendar-nav button:hover {
  background: var(--bg-page);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.calendar-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--spacing-xs);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-xs);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day.other-month {
  color: var(--text-light);
}

.calendar-day.today {
  color: var(--text-primary);
  border: 2px solid var(--primary-accent);
  font-weight: 600;
}

.calendar-day.has-event {
  background: var(--primary-accent);
  color: white;
  font-weight: 600;
}

.calendar-day:hover:not(.other-month) {
  background: var(--primary-accent-light);
  color: var(--primary-accent);
}

/* Upcoming Events */
.upcoming-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.upcoming-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.upcoming-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.upcoming-item:last-child {
  border-bottom: none;
}

.upcoming-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.upcoming-bullet.red { background-color: var(--color-red); }
.upcoming-bullet.gray { background-color: var(--text-tertiary); }
.upcoming-bullet.orange { background-color: var(--color-orange); }
.upcoming-bullet.blue { background-color: var(--color-blue); }

.upcoming-content {
  flex: 1;
}

.upcoming-event-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.upcoming-event-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.upcoming-event-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

.upcoming-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: var(--spacing-md);
  transition: color 0.2s ease;
}

.upcoming-link:hover {
  color: var(--primary-accent);
}

/* Section Titles */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
}

.section-title::after {
  content: '.';
  color: var(--primary-accent);
}

/* Layout Utilities */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  max-width: 1600px;
  margin: 0 auto;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  z-index: 100;
  background: none;
  border: none;
  align-items: center;
  justify-content: center;
}

.hamburger-menu span {
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
  display: block;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
  }
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(180deg, #1A202C 0%, #2D3748 100%);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 1000;
  padding: var(--spacing-lg);
}

.mobile-menu.active .mobile-menu-content {
  left: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: var(--spacing-xs) 0;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  background-color: rgba(233, 75, 94, 0.2);
  color: white;
  border-left-color: var(--primary-accent);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .dashboard-layout {
    grid-template-columns: 240px 1fr 280px;
  }
}

@media (max-width: 968px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
    position: relative;
  }
  
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    width: 280px;
    max-width: 85vw;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .right-sidebar {
    order: -1;
  }
  
  .top-bar {
    padding-left: 0;
  }
  
  .main-content {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Mobile Navigation */
  .desktop-nav {
    display: none;
  }
  
  .hamburger-menu {
    display: flex;
  }
}

/* User Avatar */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s ease;
}

.user-avatar:hover {
  border-color: var(--primary-accent);
}

/* Top Bar */
.top-bar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

/* Utility Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.bg-page { background-color: var(--bg-page); }
.bg-card { background-color: var(--bg-card); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* Legacy Support */
:root {
  --background: 0 0% 100%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --primary: 217 91% 20%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 217 91% 20%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 45 93% 47%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 217 91% 20%;
  --radius: 0.75rem;
  --gradient-hero: linear-gradient(135deg, hsl(217 91% 20%) 0%, hsl(217 91% 35%) 100%);
  --gradient-accent: linear-gradient(135deg, hsl(45 93% 47%) 0%, hsl(45 93% 57%) 100%);
  --shadow-lg: 0 20px 60px -15px hsl(217 91% 20% / 0.3);
  --shadow-glow: 0 0 40px hsl(45 93% 47% / 0.2);
}

.gradient-hero {
  background: var(--gradient-hero);
}

.gradient-accent {
  background: var(--gradient-accent);
}

.shadow-glow {
  box-shadow: var(--shadow-glow);
}

