@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Premium Vibrant Color Palette */
  --bg-color: #f4f6f9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  
  --secondary: #f43f5e; /* Rose */
  --accent: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  
  /* Accent Colors for Stats & Tags */
  --accent-orange-bg: #fef3c7;
  --accent-orange-txt: #d97706;
  
  --accent-purple-bg: #e0e7ff;
  --accent-purple-txt: #4338ca;
  
  --tag-urgent-bg: #ffe4e6;
  --tag-urgent-txt: #f43f5e;
  
  --card-bg: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08); /* Darker border for light mode */
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.05);
  --shadow-md: 0 8px 24px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 16px 40px rgba(99, 102, 241, 0.12);
  
  /* Border Radius */
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
body.dark-theme {
  --bg-color: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --primary-light: #1e1b4b;
  --card-bg: rgba(30, 41, 59, 0.95);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  
  --accent-orange-bg: rgba(217, 119, 6, 0.2);
  --accent-orange-txt: #fcd34d;
  
  --accent-purple-bg: rgba(67, 56, 202, 0.2);
  --accent-purple-txt: #a5b4fc;
  
  --tag-urgent-bg: rgba(244, 63, 94, 0.2);
  --tag-urgent-txt: #fda4af;
}

body.dark-theme .form-input,
body.dark-theme .modal-content,
body.dark-theme .task-item,
body.dark-theme .summary-card {
  background-color: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

body.dark-theme .summary-card .card-icon {
  /* removed !important override so variables work */
}

body.dark-theme .task-list .task-item {
  border-color: #334155;
}

body.dark-theme .btn-primary {
  color: white;
}

body.dark-theme .bottom-nav {
  border-top: 1px solid #334155;
}
body.dark-theme .header {
  border-bottom: 1px solid #334155;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 16px;
  /* Premium subtle background pattern */
  background-image: radial-gradient(var(--primary-light) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
}

/* Mobile First App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-color);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow-x: hidden;
  padding-bottom: 90px; /* Space for bottom nav */
}

/* Header */
.header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--glass-border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid white;
}

.greeting p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.greeting h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.notification-btn {
  background: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-fast);
}

.notification-btn:active {
  transform: scale(0.9);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--secondary);
  border-radius: var(--radius-full);
  border: 2px solid white;
}

/* Main Content Area */
.main-content {
  padding: 20px 24px;
}

/* Section Titles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  margin-top: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.view-all {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

/* Summary Cards (Carousel/Grid) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.summary-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #a855f7);
}

.summary-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--secondary), #fca5a5);
}

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

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.summary-card:nth-child(2) .card-icon {
  /* Using inline variables instead */
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Upcoming Class Card */
.class-card {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  margin-top: 24px;
}

.class-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

.class-time {
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}

.class-subject {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.class-details {
  font-size: 0.9rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast);
  border: 1px solid rgba(0,0,0,0.02);
}

.task-item:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
}

.task-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.task-info {
  flex: 1;
}

.task-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.task-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.task-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-tag.urgent {
  background: var(--tag-urgent-bg);
  color: var(--tag-urgent-txt);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  padding: 16px 24px 24px 24px;
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.04);
  z-index: 100;
  border-radius: 24px 24px 0 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 1.5rem;
  transition: transform var(--transition-fast);
}

.nav-item:active .nav-icon {
  transform: scale(0.9);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Floating Action Button (FAB) */
.fab {
  position: fixed;
  bottom: 110px;
  right: max(24px, calc(50vw - 216px)); /* Menjaga posisi FAB tetap menempel di kontainer 480px saat di desktop */
  z-index: 90;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  border: 4px solid white;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.fab:hover {
  transform: scale(1.05) translateY(-2px);
}

.fab:active {
  transform: scale(0.95);
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.5s var(--transition-smooth) forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }

/* Desktop Responsiveness - Centering the App */
@media (min-width: 481px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px 0;
  }
  
  .app-container {
    border-radius: 40px;
    height: 850px; /* Fixed height for preview */
    overflow-y: auto;
    border: 8px solid #cbd5e1;
  }
  
  .bottom-nav {
    position: absolute; /* Changed from fixed for desktop container */
  }
  
  /* Scrollbar for container */
  .app-container::-webkit-scrollbar {
    width: 6px;
  }
  .app-container::-webkit-scrollbar-track {
    background: transparent;
  }
  .app-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
  }
}

/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.modal-content { background: var(--bg-color); width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 24px; box-shadow: 0 -8px 32px rgba(0,0,0,0.1); }
@media (min-width: 481px) { .modal-overlay { align-items: center; } .modal-content { border-radius: 24px; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.close-modal { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-input { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--glass-border); font-family: inherit; font-size: 0.95rem; background: var(--bg-color); color: var(--text-main); outline: none; transition: border-color var(--transition-fast); }
.form-input:focus { border-color: var(--primary); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: white; border: none; padding: 14px 24px; border-radius: 12px; font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform var(--transition-fast); }
.btn-primary:active { transform: scale(0.98); }

/* Switch Toggle CSS */
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider .slider-circle { transform: translateX(20px); }
