/* ========================================
   CSS Variables - Enhanced Themes
======================================== */
:root {
  /* GLOBAL TYPOGRAPHY */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* DEFAULT THEME: Midnight Pro */
  --bg: #09090b;
  /* Zinc 950 */
  --surface: #18181b;
  /* Zinc 900 */
  --card: #27272a;
  /* Zinc 800 */
  --text: #fafafa;
  /* Zinc 50 */
  --text-secondary: #a1a1aa;
  /* Zinc 400 */
  --border: #3f3f46;
  /* Zinc 700 */
  --primary: #10b981;
  /* Emerald 500 */
  --primary-hover: #059669;
  /* Emerald 600 */
  --accent: #8b5cf6;
  /* Violet 500 */
  --danger: #ef4444;
  /* Red 500 */
  --success: #10b981;
  /* Emerald 500 */
  --warning: #f59e0b;
  /* Amber 500 */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --glass: rgba(39, 39, 42, 0.6);
}

/* THEME: Oceanic Blue */
html.oceanic {
  --bg: #0f172a;
  /* Slate 900 */
  --surface: #1e293b;
  /* Slate 800 */
  --card: #334155;
  /* Slate 700 */
  --text: #f1f5f9;
  /* Slate 100 */
  --text-secondary: #94a3b8;
  /* Slate 400 */
  --border: #475569;
  /* Slate 600 */
  --primary: #0ea5e9;
  /* Sky 500 */
  --primary-hover: #0284c7;
  /* Sky 600 */
  --accent: #38bdf8;
  /* Sky 400 */
}

/* THEME: Sunset Vibes */
html.sunset {
  --bg: #2a0a18;
  /* Very dark pink/purple */
  --surface: #451a2b;
  --card: #5e283b;
  --text: #fff0f5;
  --text-secondary: #dcbbc8;
  --border: #803d54;
  --primary: #f43f5e;
  /* Rose 500 */
  --primary-hover: #e11d48;
  /* Rose 600 */
  --accent: #fbbf24;
  /* Amber 400 */
}

/* THEME: Cyberpunk Neon */
html.cyber {
  --bg: #000000;
  --surface: #0a0a0a;
  --card: #121212;
  --text: #e0e0e0;
  --text-secondary: #888;
  --border: #333;
  --primary: #00ff41;
  /* Neon Green */
  --primary-hover: #00cc33;
  --accent: #ff00ff;
  /* Magenta */
  --shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

/* THEME: Classic Light */
html.classic {
  --bg: #f8fafc;
  /* Slate 50 */
  --surface: #ffffff;
  /* White */
  --card: #ffffff;
  /* White */
  --text: #0f172a;
  /* Slate 900 */
  --text-secondary: #64748b;
  /* Slate 500 */
  --border: #e2e8f0;
  /* Slate 200 */
  --primary: #2563eb;
  /* Blue 600 */
  --primary-hover: #1d4ed8;
  /* Blue 700 */
  --accent: #4f46e5;
  /* Indigo 600 */
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --glass: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Base Styles
======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

.notebook {
  background-image:
    repeating-linear-gradient(transparent,
      transparent 31px,
      var(--line) 31px,
      var(--line) 32px);
  background-attachment: local;
}

.chalkboard body {
  background-image:
    repeating-linear-gradient(90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px);
}

/* ========================================
   Preloader - CENTERED
======================================== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #000);
  z-index: 9999;
}

.preloader.hidden {
  display: none;
}

.loader-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 20px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.loader-tip {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 300px;
}

/* ========================================
   Enhanced Navigation with Live Stats
======================================== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand:hover {
  transform: scale(1.05);
}

.brand-icon {
  font-size: 24px;
}

/* Live Stats Display */
.live-stats {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.stat-icon {
  font-size: 16px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-item span:not(.stat-label):not(.stat-icon) {
  color: var(--primary);
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Compact Icon Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.icon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.icon-btn span {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.icon-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.icon-btn:hover::before {
  opacity: 1;
}

.icon-btn:hover span {
  transform: scale(1.1);
}

.icon-btn.success {
  border-color: var(--success);
}

.icon-btn.success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.icon-btn.success::before {
  background: linear-gradient(135deg, var(--success), #059669);
}

.icon-btn.danger {
  border-color: var(--danger);
}

.icon-btn.danger:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.icon-btn.danger::before {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

/* Theme Dropdown */
.theme-selector {
  position: relative;
}

.theme-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  min-width: 180px;
  z-index: 1000;
}

.theme-dropdown.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-dropdown button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-dropdown button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 70%;
  background: linear-gradient(90deg, var(--primary), transparent);
  transition: width 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.theme-dropdown button:hover {
  background: var(--card);
  padding-left: 16px;
  color: var(--primary);
  font-weight: 600;
}

.theme-dropdown button:hover::before {
  width: 4px;
}

/* ========================================
   Container
======================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ========================================
   Install Banner
======================================== */
.install-banner {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}

.install-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.install-icon {
  font-size: 28px;
}

.install-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.install-text p {
  font-size: 13px;
  opacity: 0.95;
}

.install-actions {
  display: flex;
  gap: 10px;
}

/* ========================================
   Hero
======================================== */
.hero {
  text-align: center;
  padding: 32px 0;
}

.hero h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Last Updated - Color Changing Animation */
.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  animation: colorChange 3s ease-in-out infinite;
}

@keyframes colorChange {

  0%,
  100% {
    color: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
  }

  25% {
    color: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  }

  50% {
    color: #ec4899;
    border-color: #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
  }

  75% {
    color: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  }
}

.update-icon {
  animation: rotate 2s linear infinite;
}

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

/* ========================================
   Toolbar
======================================== */
.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 16px;
}

.input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.input {
  padding: 12px 14px;
  cursor: pointer;
}

/* ========================================
   Image Upload Section
======================================== */
.image-upload-section {
  margin-top: 12px;
}

.image-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.image-upload-label:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.upload-icon {
  font-size: 18px;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--card);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.remove-image:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* ========================================
   Week Groups
======================================== */
.week-group {
  margin-bottom: 36px;
}

.week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  color: white;
  box-shadow: var(--shadow);
}

.week-title {
  font-size: 20px;
  font-weight: 700;
}

.week-count {
  font-size: 13px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  font-weight: 600;
}

/* ========================================
   Cards with Image Indicator
======================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  /* Tighter radius */
  padding: 20px;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  /* Side border instead of top bar */
  height: 100%;
  background: var(--primary);
  border-radius: 8px 0 0 8px;
  opacity: 0.8;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.badge {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.assignment {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.badge.quiz {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge.lab {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge.project {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

.badge.exam {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.image-indicator {
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 600;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-course {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.card-notes {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.due-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.due-day {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  font-size: 15px;
}

.countdown {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
}

.countdown.overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.countdown.soon {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.countdown.safe {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.card-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.card-link:hover {
  background: var(--primary-hover);
  transform: translateX(4px);
}

/* ========================================
   Task Modal with Image Gallery
======================================== */
.task-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.task-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.task-modal-content {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.task-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: all 0.2s;
}

.task-modal-close:hover {
  background: #dc2626;
  transform: rotate(90deg);
}

.task-modal h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  padding-right: 40px;
}

.task-modal .badge {
  margin-bottom: 16px;
}

.task-modal-course {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 600;
}

.task-modal-notes {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 20px;
  white-space: pre-wrap;
  padding: 16px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.task-modal-images {
  margin: 20px 0;
}

.task-modal-images h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
}

.gallery-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.task-modal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
}

.task-modal-info-item {
  padding: 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.task-modal-info-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.task-modal-info-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.task-modal-link {
  display: block;
  margin-top: 20px;
  padding: 14px 20px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
}

.task-modal-link:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}

/* ========================================
   Image Viewer Modal
======================================== */
.image-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(8px);
}

.image-viewer-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.image-viewer-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  transition: all 0.2s;
  z-index: 2001;
}

.image-viewer-close:hover {
  background: #dc2626;
  transform: rotate(90deg) scale(1.1);
}

#viewerImage {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   Admin Section
======================================== */
.admin-only {
  display: none;
}

.admin-active .admin-only {
  display: block;
}

.admin-section {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-top: 32px;
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.notification-settings {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.notification-settings h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

#itemForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

#itemForm .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

.btn.secondary:hover {
  background: var(--card);
}

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

.btn.danger:hover {
  background: #dc2626;
}

/* ========================================
   Table
======================================== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

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

.table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--card);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.table tr:hover {
  background: var(--card);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
}

/* ========================================
   Dialog - CENTERED
======================================== */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 440px;
  width: 90%;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

dialog h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}

dialog p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

dialog .input {
  margin-bottom: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ========================================
   Footer
======================================== */
.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 2px solid var(--border);
  margin-top: 48px;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.animated-name {
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient 3s linear infinite;
}

@keyframes gradient {
  to {
    background-position: 200% center;
  }
}

.heart {
  color: var(--danger);
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  10%,
  30% {
    transform: scale(1.15);
  }
}

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

.empty-state .icon {
  font-size: 64px;
  opacity: 0.5;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .nav-container {
    padding: 12px 16px;
  }

  .live-stats {
    order: -1;
    width: 100%;
    justify-content: space-around;
  }

  .hero h2 {
    font-size: 28px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

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

  #itemForm {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .task-modal-content {
    padding: 24px;
  }

  .task-modal-info {
    grid-template-columns: 1fr;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .week-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .install-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .install-actions {
    width: 100%;
  }

  .install-actions .btn {
    flex: 1;
  }

  #viewerImage {
    max-width: 95%;
    max-height: 80%;
  }
}

@media (max-width: 480px) {
  .nav-brand {
    font-size: 18px;
  }

  .brand-icon {
    font-size: 20px;
  }

  .hero h2 {
    font-size: 24px;
  }

  .stat-item {
    font-size: 12px;
  }

  .image-preview {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}