/* ====================================
   EECS 498 AASE Course Website Styles
   ==================================== */

:root {
  /* Colors - Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-accent: #f1f3f5;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --link-color: #5B7FF7;
  --link-hover: #4A6AE6;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #5B7FF7 0%, #8B5CF6 100%);
  --gradient-hero: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #252525;
  --bg-accent: #2d2d2d;
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --text-muted: #868e96;
  --border-color: #3a3a3a;
  --link-color: #7B9FF8;
  --link-hover: #9BB5F9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* ====================================
   Reset & Base Styles
   ==================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ====================================
   Typography
   ==================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

h1 {
  font-size: 3rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.25rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

code {
  font-family: var(--font-mono);
  background: var(--bg-accent);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ====================================
   Navigation
   ==================================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

nav.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .course-code {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--link-color);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-accent);
  transform: scale(1.05);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* ====================================
   Layout & Containers
   ==================================== */

main {
  margin-top: 72px;
  min-height: calc(100vh - 72px);
}

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

.wide-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: var(--spacing-xl) 0;
}

section:nth-child(even) {
  background: var(--bg-secondary);
}

/* ====================================
   Hero Section
   ==================================== */

.hero {
  background: var(--gradient-hero);
  padding: var(--spacing-xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-md);
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-sm);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  font-weight: 400;
}

.hero-description {
  max-width: 800px;
  margin: 0 auto var(--spacing-md);
  font-size: 1.25rem;
  line-height: 1.7;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

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

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

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

/* ====================================
   Info Cards
   ==================================== */

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: var(--spacing-lg) 0;
}

.info-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--link-color);
}

.info-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.info-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.info-card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

/* ====================================
   Phase Cards
   ==================================== */

.phase-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-lg);
}

.phase-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.phase-card:hover::before {
  transform: scaleX(1);
}

.phase-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.phase-number {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.phase-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.phase-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.phase-card ul {
  list-style: none;
  margin-top: 1rem;
}

.phase-card li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
}

.phase-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--link-color);
  font-weight: 700;
}

/* ====================================
   Instructor Grid
   ==================================== */

.instructor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-lg);
}

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

img.instructor-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

div.instructor-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient-primary);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.instructor-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.instructor-role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.instructor-contact {
  color: var(--link-color);
  font-size: 0.9rem;
}

/* ====================================
   Deliverables Grid
   ==================================== */

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: var(--spacing-lg);
}

.deliverable-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.deliverable-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--link-color);
}

.deliverable-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.deliverable-card h3 {
  margin-bottom: 1rem;
}

/* ====================================
   Schedule Table
   ==================================== */

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.schedule-table thead {
  background: var(--gradient-primary);
  color: white;
}

.schedule-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

.schedule-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.schedule-table tbody tr:hover {
  background: var(--bg-accent);
}

.schedule-table .phase-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-accent);
  color: var(--link-color);
}

/* ====================================
   Grading Section
   ==================================== */

.grading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: var(--spacing-lg) 0;
}

.grading-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.grading-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

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

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

.grade-label {
  color: var(--text-secondary);
}

.grade-weight {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--link-color);
}

.progress-bar {
  height: 8px;
  background: var(--bg-accent);
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

/* ====================================
   FAQ Section
   ==================================== */

.faq-category {
  margin-bottom: var(--spacing-lg);
}

.faq-category h2 {
  margin-bottom: var(--spacing-md);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.faq-question:hover {
  color: var(--link-color);
}

.faq-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  color: var(--link-color);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
  margin-bottom: 0.5rem;
}

.faq-answer ul {
  margin: 0.5rem 0 0.5rem 1.5rem;
  color: var(--text-secondary);
}

/* ====================================
   Policy Boxes
   ==================================== */

.policy-box {
  background: var(--bg-primary);
  border-left: 4px solid var(--link-color);
  padding: 1.5rem;
  margin: var(--spacing-md) 0;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.policy-box h3 {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.policy-box ul {
  margin-left: 1.5rem;
  color: var(--text-secondary);
}

.policy-box li {
  margin-bottom: 0.5rem;
}

/* ====================================
   Footer
   ==================================== */

footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg) 0;
  text-align: center;
  color: var(--text-muted);
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

footer a {
  color: var(--link-color);
}

/* ====================================
   Animations
   ==================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }
.fade-in:nth-child(6) { transition-delay: 0.6s; }

/* ====================================
   Week Cards (Syllabus)
   ==================================== */

.phase-divider {
  background: var(--gradient-primary);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin: var(--spacing-lg) 0 var(--spacing-md);
  text-align: center;
}

.phase-divider-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.phase-divider h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: white;
}

.phase-divider p {
  font-size: 1.1rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.week-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.week-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--link-color);
}

.week-header {
  background: var(--bg-accent);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.week-number {
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.week-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.week-content {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.week-section {
  min-width: 0;
}

.week-section h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.week-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.week-section li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-secondary);
  line-height: 1.6;
}

.week-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--link-color);
  font-weight: 700;
}

.week-section a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}

.week-section a:hover {
  text-decoration-color: var(--link-color);
}

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

.due-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ====================================
   Contact Section
   ==================================== */

.contact-section {
  padding: var(--spacing-md) 0;
}

.contact-section h2 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: var(--spacing-lg);
}

.contact-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--link-color);
}

.contact-card h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.contact-card p {
  margin: 0.5rem 0;
}

.contact-card a {
  font-weight: 600;
  font-size: 1.1rem;
}

.contact-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.instructors-contact {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.instructors-contact h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.instructors-contact ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.instructors-contact li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.instructors-contact li:last-child {
  border-bottom: none;
}

.instructors-contact strong {
  color: var(--text-primary);
  margin-right: 0.5rem;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero .subtitle {
    font-size: 1.25rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li {
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .phase-cards,
  .info-cards,
  .deliverables-grid {
    grid-template-columns: 1fr;
  }
  
  .schedule-table {
    font-size: 0.85rem;
  }
  
  .schedule-table th,
  .schedule-table td {
    padding: 0.5rem;
  }
  
  section {
    padding: var(--spacing-md) 0;
  }
  
  .container,
  .wide-container {
    padding: 0 1rem;
  }
  
  .week-content {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }
  
  .week-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }
  
  .phase-divider {
    padding: 1.5rem;
  }
  
  .phase-divider h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
}
