/* Design Theme System for Life Organized AI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Font Families */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette - Default Light Mode */
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-left-hero: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border: #e2e8f0;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(148, 163, 184, 0.12);
  --shadow-lg: 0 10px 30px -5px rgba(148, 163, 184, 0.18);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(12px);
}

/* Dark Mode / Night Mode Variables */
body.dark-mode {
  --bg-app: #090d16;
  --bg-sidebar: #0f1422;
  --bg-left-hero: linear-gradient(135deg, #111428 0%, #0d0f1e 100%);
  --bg-card: rgba(18, 24, 41, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.4);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #090d16;
  
  --border: rgba(255, 255, 255, 0.08);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #2e1065;
  --primary-glow: rgba(139, 92, 246, 0.2);
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.1);
  
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.35);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Main Layout Grid */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Static Branding Left Panel (Desktop only) */
.brand-intro-panel {
  width: 320px;
  background: var(--bg-left-hero);
  border-right: 1px solid var(--border);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .brand-intro-panel {
    display: none;
  }
}

.brand-intro-header {
  text-align: left;
}

.brand-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.brand-title-group h1 {
  font-size: 24px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.brand-intro-panel p.tagline {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.brand-intro-panel p.desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.brand-hero-illustration {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0;
  position: relative;
  min-height: 240px;
}

.brand-hero-illustration img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform 0.5s ease;
}

.brand-hero-illustration:hover img {
  transform: translateY(-8px) scale(1.02);
}

/* Fallback SVG Workspace styling if image copy is slow */
.brand-hero-illustration svg {
  width: 100%;
  height: 200px;
}

.brand-quote-card {
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

/* Primary App Panel Layout (Sidebar + Header + Content) */
.primary-workspace {
  flex-grow: 1;
  display: flex;
  min-height: 100vh;
}

/* Navigation Sidebar */
.nav-sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  transition: background-color 0.4s ease;
}

@media (max-width: 768px) {
  .nav-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex !important;
  }
  .nav-sidebar.active {
    left: 0;
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 25px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.menu-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  transition: var(--transition);
}

.menu-item button:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
}

.menu-item.active button {
  color: var(--text-inverse);
  background: var(--primary-gradient);
  box-shadow: var(--shadow-glow);
}

.sidebar-gamification {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.streak-sidebar-card {
  background: var(--bg-card-hover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  text-align: center;
}

.streak-sidebar-card .fire {
  font-size: 28px;
  margin-bottom: 4px;
  display: inline-block;
  animation: flame 1.5s infinite alternate;
}

@keyframes flame {
  0% { transform: scale(1); }
  100% { transform: scale(1.15) rotate(2deg); }
}

.streak-sidebar-card h4 {
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0;
}

.streak-sidebar-card p {
  font-size: 11px;
  color: var(--text-muted);
}

.xp-sidebar-card {
  background: var(--bg-card-hover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
}

.xp-sidebar-card h4 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.xp-sidebar-card p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.xp-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}

.xp-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
}

/* App Main Content Area */
.app-content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
}

/* Top Header Bar */
.main-header {
  height: 70px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.4s ease;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  width: 320px;
  gap: 10px;
  transition: var(--transition);
}

.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search input {
  border: none;
  background: none;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.action-btn {
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.action-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-app);
}

.action-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.lang-toggle-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}

.lang-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.profile-badge:hover {
  background-color: var(--bg-app);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  color: white;
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info {
  text-align: left;
}

.profile-info .hi {
  font-size: 13px;
  font-weight: 700;
}

.profile-info .lvl {
  font-size: 11px;
  color: var(--text-muted);
}

/* Tabs Views Sections */
.tab-content {
  padding: 30px;
  flex-grow: 1;
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard View Styles */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-hero-section {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .dashboard-hero-section {
    grid-template-columns: 1fr;
  }
}

.glass-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: var(--transition);
  backdrop-filter: var(--glass-blur);
}

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

.greeting-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.greeting-card h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.greeting-card p {
  font-size: 14px;
  color: var(--text-muted);
}

.weather-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.weather-info {
  display: flex;
  flex-direction: column;
}

.weather-info h3 {
  font-size: 28px;
  font-weight: 800;
}

.weather-info .desc {
  font-size: 14px;
  font-weight: 700;
  margin: 2px 0;
}

.weather-info .loc {
  font-size: 12px;
  color: var(--text-muted);
}

.weather-icon {
  font-size: 45px;
  animation: float 3s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.ai-score-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.score-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.score-value span {
  font-size: 14px;
  color: var(--text-muted);
}

.score-label {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.score-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.sparkline-canvas {
  width: 100%;
  height: 40px;
  margin-top: 10px;
}

/* Metric Strip (4 Mini metrics) */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-details h4 {
  font-size: 18px;
  font-weight: 800;
}

.metric-details p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-progress-container {
  width: 100%;
  height: 6px;
  background-color: var(--border);
  border-radius: 3px;
  margin-top: 6px;
}

.metric-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  width: 0%;
}

/* Panel Tri-column layout */
.dashboard-panels-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .dashboard-panels-row {
    grid-template-columns: 1fr;
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header .see-all {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

/* Schedule List */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.schedule-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.schedule-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: -16px;
  width: 2px;
  background-color: var(--border);
}

.schedule-item:last-child::before {
  display: none;
}

.schedule-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--bg-card);
  z-index: 1;
}

.schedule-dot.break { background-color: var(--warning); }
.schedule-dot.high { background-color: var(--danger); }
.schedule-dot.medium { background-color: var(--primary); }
.schedule-dot.low { background-color: var(--success); }

.schedule-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.schedule-content {
  flex-grow: 1;
  background-color: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schedule-task-title {
  font-size: 13px;
  font-weight: 600;
}

.schedule-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.schedule-badge.high { background: var(--danger-light); color: var(--danger); }
.schedule-badge.medium { background: var(--primary-light); color: var(--primary); }
.schedule-badge.low { background: var(--success-light); color: var(--success); }
.schedule-badge.break { background: var(--warning-light); color: var(--warning); }

.panel-action-footer {
  margin-top: 15px;
}

.panel-action-footer button {
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.panel-action-footer button:hover {
  background-color: var(--primary);
  color: white;
}

/* Priority Card style */
.priority-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 280px;
  overflow-y: auto;
}

.priority-category-item {
  border-left: 4px solid var(--border);
  padding-left: 12px;
}

.priority-category-item.high { border-color: var(--danger); }
.priority-category-item.medium { border-color: var(--warning); }
.priority-category-item.low { border-color: var(--success); }

.priority-cat-header {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 4px;
}
.priority-category-item.high .priority-cat-header { color: var(--danger); }
.priority-category-item.medium .priority-cat-header { color: var(--warning); }
.priority-category-item.low .priority-cat-header { color: var(--success); }

.priority-task-item {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.priority-reasoning {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Achievements List */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
}

.achievement-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--primary-light);
}

.achievement-info h4 {
  font-size: 12px;
  font-weight: 700;
}

.achievement-info p {
  font-size: 10px;
  color: var(--text-muted);
}

/* Bottom tip widget */
.dashboard-bottom-bar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 768px) {
  .dashboard-bottom-bar {
    grid-template-columns: 1fr;
  }
}

.ai-tip-widget-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tip-robot-mascot {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tip-robot-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tip-content h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.tip-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.add-task-primary-btn {
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.add-task-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

/* Tasks Tab Layout */
.tasks-layout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.tasks-filters {
  display: flex;
  gap: 10px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}

.filter-chip.active, .filter-chip:hover {
  color: var(--text-inverse);
  background: var(--primary-gradient);
  border-color: transparent;
}

.tasks-kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .tasks-kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kanban-column-header h3 {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count-tag {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 400px;
  background-color: rgba(148, 163, 184, 0.03);
  padding: 10px;
  border-radius: var(--radius-md);
}

.task-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: grab;
  transition: var(--transition);
}

.task-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.task-card-category {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.task-card-difficulty {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.task-card-difficulty.easy { background: var(--success-light); color: var(--success); }
.task-card-difficulty.medium { background: var(--warning-light); color: var(--warning); }
.task-card-difficulty.hard { background: var(--danger-light); color: var(--danger); }

.task-card h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.task-card p.task-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.task-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.task-action-btn {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  background-color: var(--bg-app);
  padding: 6px 2px;
  border-radius: 4px;
  transition: var(--transition);
}

.task-action-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Subtasks dropdown list inside cards */
.task-subtasks-dropdown {
  margin-top: 8px;
  background-color: var(--bg-app);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subtask-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  cursor: pointer;
}

.subtask-checkbox-item input {
  cursor: pointer;
}

.subtask-checkbox-item.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Modals Overlay & Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg-sidebar);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 30px;
  width: 500px;
  max-width: 90%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
}

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

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

.btn-secondary {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-app);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}

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

.btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: white;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

/* AI Planner tab specific styling */
.planner-info-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.planner-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.planner-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Calendar tab specific styling */
.calendar-view-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
}

.calendar-cell {
  background-color: var(--bg-app);
  border-radius: var(--radius-sm);
  min-height: 80px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-cell.inactive {
  opacity: 0.4;
}

.calendar-cell.today {
  border: 2px solid var(--primary);
}

.calendar-task-tag {
  font-size: 9px;
  font-weight: 700;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 2px 4px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Analytics Tab styling */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card-wrapper {
  display: flex;
  flex-direction: column;
  height: 320px;
  min-height: 320px;
  position: relative;
}

.chart-card-wrapper canvas {
  flex-grow: 1;
  max-height: calc(100% - 40px) !important;
  width: 100% !important;
}

/* Chat AI interface */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 550px;
}

.chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 80%;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--primary-light);
}

.chat-message-content {
  background-color: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.chat-message.user .chat-message-content {
  background: var(--primary-gradient);
  color: white;
}

.chat-input-row {
  display: flex;
  gap: 12px;
}

.chat-input-row input {
  flex-grow: 1;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  transition: opacity 0.3s, border-color 0.3s;
}

/* Locked state — shown when no API key is configured */
.chat-input-row input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: var(--border);
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 4px,
    rgba(100,100,100,0.04) 4px,
    rgba(100,100,100,0.04) 8px
  );
}

.chat-input-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Settings tab components */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section-title {
  font-size: 15px;
  font-weight: 800;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Goals and achievements panel view styles */
.goals-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .goals-layout {
    grid-template-columns: 1fr;
  }
}

.badges-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.badge-gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  opacity: 0.4;
  filter: grayscale(1);
  transition: var(--transition);
}

.badge-gallery-item.unlocked {
  opacity: 1;
  filter: grayscale(0);
  border-color: var(--primary);
  background: var(--bg-card);
}

.badge-gallery-item h4 {
  font-size: 12px;
  font-weight: 800;
  margin: 10px 0 4px;
}

.badge-gallery-item p {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Weekly challenges styling */
.challenge-card {
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.challenge-card.completed {
  border-color: var(--success);
}

.challenge-details h4 {
  font-size: 13px;
  font-weight: 700;
}

.challenge-details p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.challenge-xp-reward {
  font-size: 11px;
  font-weight: 800;
  color: var(--warning);
  margin-top: 4px;
}

.challenge-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.challenge-progress-num {
  font-size: 11px;
  font-weight: 800;
}

/* Notifications popup overlay in UI */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-sidebar);
  color: var(--text-main);
  border-left: 5px solid var(--primary);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.active {
  transform: translateY(0);
}

.toast-notification.xp-gain {
  border-left-color: var(--warning);
}

.toast-notification.level-up {
  border-left-color: var(--success);
  background: var(--primary-gradient);
  color: white;
}

/* Mobile Bottom Navigation Styles */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 999;
    padding: 0 8px;
    backdrop-filter: var(--glass-blur);
    transition: background-color 0.4s ease;
  }
  
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 4px;
    flex: 1;
    height: 100%;
    transition: var(--transition);
    background: none;
    border: none;
  }
  
  .mobile-nav-item.active {
    color: var(--primary);
  }
  
  .mobile-nav-icon {
    font-size: 20px;
  }
  
  .mobile-nav-label {
    font-size: 10px;
    font-weight: 700;
  }
  
  /* Layout Adjustments for Mobile */
  .app-content-wrapper {
    padding-bottom: 80px; /* prevent overlap with bottom nav */
  }
  
  .main-header {
    padding: 0 16px;
  }
  
  .header-search {
    width: 140px; /* shrink search bar on mobile */
  }
  
  .tab-content {
    padding: 16px;
  }
  
  /* Additional layout stacking */
  .metrics-strip {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .dashboard-bottom-bar {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .metrics-strip {
    grid-template-columns: 1fr;
  }
  
  .header-search {
    display: none; /* hide search on very small phones to make room for name and profile */
  }
}

/* Custom Styles for AI Chat & Sidebar API Key Card */
.sidebar-api-card {
  background: var(--bg-card-hover);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 14px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-api-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-api-input-container {
  display: flex;
  gap: 8px;
}

.sidebar-api-input-container input {
  flex-grow: 1;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.sidebar-api-input-container input:focus {
  border-color: var(--primary);
}

.sidebar-api-btn {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-inverse);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.sidebar-api-btn:hover {
  opacity: 0.9;
}

/* Chat Layout Styles */
.chat-view-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 15px;
  align-items: start;
}

.chat-view-header-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 5px;
}

.chat-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-brand-header span {
  font-size: 24px;
}

.chat-brand-header h2 {
  font-size: 22px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.chat-desktop-mascot-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.chat-desktop-mascot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.chat-mascot-img-large {
  width: 140px;
  height: 140px;
  object-fit: contain;
  animation: float-animation 3s ease-in-out infinite;
}

.chat-mascot-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  animation: float-animation 3s ease-in-out infinite;
}

@keyframes float-animation {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

.chat-desktop-mascot-container h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.chat-desktop-mascot-container p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.chat-desktop-mascot-container .chat-mascot-bio {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg-app);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 10px;
  text-align: left;
}

/* Mobile responsive adjustments */
.chat-mobile-mascot {
  display: none;
}

@media (max-width: 992px) {
  .chat-view-layout {
    grid-template-columns: 1fr;
  }
  
  .chat-desktop-mascot-panel {
    display: none;
  }
  
  .chat-mobile-mascot {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }
}

/* Hamburger Toggler Button style */
.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-normal);
  padding: 8px;
  margin-right: 12px;
}

@media (max-width: 768px) {
  .menu-toggle-btn {
    display: block;
  }
}

/* AI Morning Summary Card Styles */
.ai-summary-card {
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.ai-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #6366f1, #8b5cf6);
}

.ai-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ai-summary-icon {
  font-size: 20px;
  animation: shine 2s infinite alternate;
}

@keyframes shine {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(139, 92, 246, 0.5)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8)); }
}

.ai-summary-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-summary-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-normal);
}

.ai-summary-body ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.ai-summary-body li {
  margin-bottom: 4px;
}

.refresh-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.refresh-btn:hover {
  background-color: rgba(99, 102, 241, 0.1);
  transform: rotate(180deg);
  color: var(--primary);
}

