/**
 * AgendAsk Main Stylesheet
 * Mobile-first responsive design with theme support
 */

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

:root {
  /* Color Palette - Navy Blue */
  --color-primary: #1A365D;
  --color-white: #FFFFFF;
  --color-light: #F2F2F7;
  --color-accent: #2D4A6F;
  --color-success: #34C759;
  --color-danger: #FF3B30;
  --color-warning: #FF9500;
  --color-info: #5AC8FA;

  /* Typography */
  --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.5;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius - Apple Style */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows - Apple Style */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  /* Z-index scale */
  --z-sticky: 100;
  --z-fixed: 200;
  --z-modal: 300;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --color-bg: #121212;
  --color-surface: #1e1e1e;
  --color-text: #ffffff;
  --color-text-muted: #a0a0a0;
  --color-border: #333333;
}

/* Light Theme */
[data-theme="light"] {
  --color-bg: #ffffff;
  --color-surface: #F2F2F7;
  --color-text: #000000;
  --color-text-muted: #8E8E93;
  --color-border: #C7C7CC;
}

/* Ensure default light theme */
:root {
  --color-bg: #ffffff;
  --color-surface: #F2F2F7;
  --color-text: #000000;
  --color-text-muted: #8E8E93;
  --color-border: #C7C7CC;
}

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

/* Prevent horizontal overflow globally */
img,
video,
iframe,
object,
embed {
  max-width: 100%;
  height: auto;
}

html {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Mobile-first layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-header {
  background-color: #1A365D;
  color: var(--color-white);
  padding: var(--spacing-md);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  min-height: 56px;
  font-weight: 500;
  background: linear-gradient(135deg, #1A365D 0%, #2D4A6F 100%);
}

.app-header > div:first-child {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1.5;
}

.breadcrumb {
  color: #7FB3D3;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
  font-size: 1rem;
  vertical-align: baseline;
}

/* Bottom Navigation Bar - Native App Style */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: var(--z-fixed);
  border-top: 1px solid var(--color-border);
}

.app-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex: 1;
  max-width: 80px;
  min-height: 60px;
  position: relative;
}

/* Pomodoro active indicator on nav */
.nav-pomodoro-indicator {
  position: absolute;
  top: 6px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34C759; /* running */
  box-shadow: 0 0 0 2px #fff;
  display: none;
}

.nav-pomodoro-indicator.active { display: block; }
.nav-pomodoro-indicator.paused { background-color: #FF9500; }
.nav-pomodoro-indicator.break { background-color: #5AC8FA; }

/* Planner banner for active pomodoro */
#planner-pomodoro-banner {
  background: #fff;
  border-left: 4px solid #1A365D;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#planner-pomodoro-banner .banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#planner-pomodoro-banner .banner-title {
  font-weight: 600;
}

#planner-pomodoro-banner .banner-sub {
  font-size: 0.875rem;
  color: #8E8E93;
}

#planner-pomodoro-banner .banner-btn {
  background: #1A365D;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-weight: 600;
}

.app-nav a i {
  font-size: 22px;
}

.app-nav a span {
  font-size: 11px;
  font-weight: 500;
  display: none;
}

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

.app-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background-color: #1A365D;
  border-radius: 0 0 3px 3px;
}

.app-main {
  flex: 1;
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-md) + 80px); /* Space for bottom nav */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Views */
.view {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.view.d-none {
  display: none;
}

/* Task Cards - Apple Style */
.task-card {
  background-color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.task-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.task-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.task-card .task-meta {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

.task-card .badge {
  font-size: 0.75rem;
}

.task-actions {
  display: flex;
  gap: var(--spacing-sm);
}

/* Task Action Buttons - Apple Style */
.task-actions-container {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  flex-shrink: 0;
}

.action-btn i {
  font-size: 1.1rem;
}

/* Start button (primary action) */
.btn-start {
  background-color: #1A365D;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-start:hover {
  background-color: #0051D5;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.btn-start:active {
  transform: scale(0.95);
}

/* Active task button */
.btn-active {
  background-color: #FF9500;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.btn-active:hover {
  background-color: #CC7700;
  transform: scale(1.05);
}

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

/* Complete button */
.btn-complete {
  background-color: #34C759;
  box-shadow: 0 2px 8px rgba(52, 199, 89, 0.3);
}

.btn-complete:hover {
  background-color: #28A745;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.btn-complete:active {
  transform: scale(0.95);
}

/* Manage button (secondary action) */
.btn-manage {
  background-color: #8E8E93;
  box-shadow: 0 2px 8px rgba(142, 142, 147, 0.2);
}

.btn-manage:hover {
  background-color: #636366;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(142, 142, 147, 0.3);
}

.btn-manage:active {
  transform: scale(0.95);
}

/* Unschedule button */
.btn-unschedule {
  background-color: #FF9500;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.2);
}

.btn-unschedule:hover {
  background-color: #CC7700;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.btn-unschedule:active {
  transform: scale(0.95);
}

/* Capture Button - Integrated in Nav */
.btn-capture {
  min-width: 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #1A365D;
  border: 3px solid var(--color-white);
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 -4px 0 0 rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: -8px 0 0 0;
  position: relative;
  flex-shrink: 0;
}

.btn-capture i {
  font-size: 1.5rem;
  line-height: 1;
}

.btn-capture:active {
  transform: scale(0.92);
  background-color: #001a33;
}

.btn-capture::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 4px solid var(--color-primary);
  opacity: 0.3;
}

/* Schedule - Apple Style */
/* Compact Header Stats */
.planner-header-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1A365D;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: #8E8E93;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: #E0E0E0;
  margin: 0 8px;
}

.stat-item-danger .stat-value {
  color: #DC3545;
}

.stat-item-warning .stat-value {
  color: #FFA500;
}

.stat-item-success .stat-value {
  color: #28A745;
}

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

.stat-card-danger {
  border-left: 4px solid var(--color-danger);
}

.stat-card-warning {
  border-left: 4px solid var(--color-warning);
}

.stat-card-success {
  border-left: 4px solid var(--color-success);
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: var(--spacing-xs);
  opacity: 0.8;
}

.stat-icon i {
  display: block;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-accent);
  line-height: 1.2;
}

.stat-card-danger .stat-value {
  color: var(--color-danger);
}

.stat-card-warning .stat-value {
  color: var(--color-warning);
}

.stat-card-success .stat-value {
  color: var(--color-success);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
  line-height: 1.3;
  font-weight: 500;
}

.schedule-grid {
  display: grid;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.schedule-slot {
  background-color: #ffffff;
  border-left: 4px solid #007AFF;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.schedule-slot .slot-time {
  font-weight: 600;
  color: #007AFF;
  margin-bottom: 8px;
}

.schedule-slot .slot-content {
  color: #000000;
}

/* Calendar Views */
.calendar-toolbar {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.calendar-month-view {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.calendar-grid-month {
  background-color: var(--color-border);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border);
}

.calendar-weekday {
  padding: var(--spacing-sm);
  font-weight: 700;
  text-align: center;
  background-color: var(--color-surface);
  color: var(--color-accent);
  text-transform: uppercase;
  font-size: 0.875rem;
  border-bottom: 2px solid var(--color-border);
}

.calendar-day-cell {
  min-height: 100px;
  padding: var(--spacing-sm);
  background-color: var(--color-surface);
  position: relative;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-day-cell:hover {
  background-color: rgba(0, 116, 217, 0.05);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.calendar-day-cell.empty {
  background-color: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
}

.calendar-day-cell.empty:hover {
  background-color: transparent;
  border: none;
  transform: none;
  box-shadow: none;
}

.calendar-day-cell.today {
  background-color: rgba(13, 110, 253, 0.15);
  border: 2px solid var(--color-accent);
}

.day-number {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.day-event {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: white;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Week View */
.calendar-week-view {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  overflow-x: hidden;
}

.calendar-week-hours {
  display: flex;
  flex-direction: column;
}

.week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 1px;
  background-color: var(--color-border);
}

.week-day-header {
  padding: var(--spacing-sm);
  text-align: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
}

.week-day-number {
  font-size: 1.5rem;
  font-weight: bold;
}

.week-hours {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background-color: var(--color-border);
}

.week-hour-row {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  min-height: 50px;
  background-color: var(--color-border);
}

.hour-label {
  padding: var(--spacing-xs);
  background-color: var(--color-surface);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  border: 1px solid var(--color-border);
}

.week-days-events {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--color-border);
}

.week-day-slot {
  min-height: 50px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  position: relative;
  padding: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.week-day-slot:hover {
  background-color: rgba(0, 116, 217, 0.05);
  border-color: var(--color-accent);
}

.day-events-slot {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.day-events-slot:hover {
  background-color: rgba(0, 116, 217, 0.05);
  border-color: var(--color-accent);
}

.week-event {
  padding: 4px;
  border-radius: 2px;
  font-size: 0.75rem;
  color: white;
  margin-bottom: 2px;
}

/* Day View */
.calendar-day-view {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  overflow-y: auto;
  max-height: 70vh;
}

.day-header {
  margin-bottom: var(--spacing-md);
}

.day-hours {
  display: flex;
  flex-direction: column;
}

.day-hour-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--spacing-sm);
  min-height: 60px;
  margin-bottom: var(--spacing-xs);
}

.day-events-slot {
  background-color: var(--color-surface);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.day-event-item {
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  color: white;
  margin-bottom: var(--spacing-xs);
}

.day-event-item:last-child {
  margin-bottom: 0;
}

.event-time {
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.event-title {
  font-weight: 600;
}

.event-desc {
  font-size: 0.75rem;
  opacity: 0.9;
}

.schedule-slot .slot-reason {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

/* Settings */
.settings-section {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.settings-section h5 {
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
}

.settings-section .form-range {
  margin-top: var(--spacing-sm);
}

/* Pomodoro - Redesigned */
.pomodoro-welcome {
  text-align: center;
  padding: 40px 20px;
}

.pomodoro-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #1A365D 0%, #2D4A6F 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(26, 54, 93, 0.3);
}

.pomodoro-icon i {
  font-size: 3rem;
  color: white;
}

.pomodoro-welcome h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
}

.pomodoro-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.pomodoro-task-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.pomodoro-task-item h6 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
}

.task-duration {
  margin: 0;
  font-size: 0.875rem;
  color: #8E8E93;
}

.task-duration i {
  margin-right: 4px;
}

.start-pomodoro-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #1A365D;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.start-pomodoro-btn:hover {
  background-color: #0051D5;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.start-pomodoro-btn i {
  font-size: 1.5rem;
}

/* Active Pomodoro View */
.pomodoro-active {
  padding: 20px;
}

.pomodoro-header {
  text-align: center;
  margin-bottom: 32px;
}

.current-task {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 122, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  color: #007AFF;
  font-weight: 500;
}

.current-task i {
  font-size: 1.1rem;
}

.pomodoro-timer-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 40px;
}

.pomodoro-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pomodoro-circle-bg {
  fill: none;
  stroke: #F2F2F7;
  stroke-width: 12;
}

.pomodoro-circle-progress {
  fill: none;
  stroke: #007AFF;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.pomodoro-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.time-display {
  font-size: 3.5rem;
  font-weight: 300;
  color: #000;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
}

.time-label {
  font-size: 0.875rem;
  color: #8E8E93;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pomodoro-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.pomodoro-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 28px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Evitar saltos de ancho cuando cambia el texto Pausar/Reanudar */
.pomodoro-btn.btn-toggle span:last-child {
  display: inline-block;
  min-width: 9ch; /* espacio suficiente para "Reanudar" */
}

.btn-toggle {
  background-color: #1A365D;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-toggle:hover {
  background-color: #0051D5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.btn-toggle:active {
  transform: translateY(0);
}

.btn-stop {
  background-color: white;
  color: #FF3B30;
  border: 2px solid #FF3B30;
}

.btn-stop:hover {
  background-color: #FF3B30;
  color: white;
  transform: translateY(-2px);
}

.btn-stop:active {
  transform: translateY(0);
}

.pomodoro-btn i {
  font-size: 1.2rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: var(--z-modal);
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

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

.badge.bg-warning {
  background-color: var(--color-warning);
  color: #000;
}

.badge.bg-primary {
  background-color: #1A365D;
  color: white;
}

.badge.bg-secondary {
  background-color: var(--color-text-muted);
  color: white;
}

.badge.bg-info {
  background-color: var(--color-info);
  color: white;
}

/* Responsive */
@media (min-width: 768px) {
  .app-nav {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    background-color: #1A365D;
    color: var(--color-white);
    box-shadow: none;
    border-top: none;
    padding: var(--spacing-sm) var(--spacing-md);
    max-width: none;
  }
  
  .app-nav a {
    color: rgba(255, 255, 255, 0.7);
    flex-direction: row;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    max-width: none;
    min-height: auto;
  }
  
  .app-nav a span {
    display: inline;
    font-size: 0.875rem;
  }
  
  .app-nav .btn-capture {
    margin: 0;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
  
  .app-nav .btn-capture i {
    font-size: 1.25rem;
  }
  
  .app-nav a.active {
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .app-nav a.active::before {
    display: none;
  }
  
  .app-main {
    padding-bottom: var(--spacing-md);
  }
  
  /* Hide nav capture button, show header one in desktop */
  .app-nav .btn-capture {
    display: none;
  }
  
  .btn-capture-desktop {
    display: inline-flex !important;
    margin: 0;
    border: none;
    width: auto;
    min-width: auto;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    font-size: 0.875rem;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }
  
  .btn-capture-desktop:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  .btn-capture-desktop i {
    font-size: 1rem;
  }

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

  .schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pomodoro-timer-wrapper {
    width: 350px;
    height: 350px;
  }
  
  .time-display {
    font-size: 4.5rem;
  }

  .calendar-week-view {
    overflow-x: auto;
  }
}

@media (min-width: 1024px) {
  .app-main {
    padding: var(--spacing-lg);
  }

  .schedule-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Accessibility */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.fade-in {
  animation: fadeIn var(--transition-base);
}

/* Loading */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--color-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: var(--spacing-lg) auto;
}

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

/* Utils */
.d-none {
  display: none !important;
}

.text-center {
  text-align: center !important;
}

.mt-3 {
  margin-top: var(--spacing-md) !important;
}

.mb-3 {
  margin-bottom: var(--spacing-md) !important;
}

.mt-4 {
  margin-top: var(--spacing-lg) !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.small {
  font-size: 0.875rem;
}

.text-muted {
  color: var(--color-text-muted) !important;
}

/* Calendar Styles - FullCalendar Customization */
.calendar-grid {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.calendar-header {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

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

.calendar-weekday {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

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

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.calendar-day:hover {
  background-color: var(--color-light);
}

.calendar-day.empty {
  visibility: hidden;
}

.day-number {
  font-size: 0.875rem;
}

/* FullCalendar Modern Styles */
#calendar-container {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* FullCalendar Toolbar */
.fc-toolbar {
  background: linear-gradient(135deg, #1A365D 0%, #2D4A6F 100%);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  color: white;
}

.fc-toolbar-title {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  color: white !important;
  font-family: 'Manrope', sans-serif;
}

.fc-button-group,
.fc-button {
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  font-size: 0.875rem !important;
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  transition: all 0.2s ease !important;
}

.fc-button:hover {
  background-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.fc-button:active {
  transform: translateY(0);
}

.fc-button-active {
  background: white !important;
  color: #1A365D !important;
  font-weight: 600 !important;
}

/* Calendar Header (Days of Week) */
.fc-col-header-cell {
  background: linear-gradient(135deg, #F2F2F7 0%, #E8E8ED 100%);
  border: none !important;
  padding: 12px 8px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
  color: #1A365D;
  border-bottom: 2px solid #1A365D !important;
}

/* Day Cells */
.fc-daygrid-day {
  border: 1px solid #E0E0E0 !important;
  transition: all 0.2s ease;
  background: white;
}

.fc-daygrid-day:hover {
  background: rgba(26, 54, 93, 0.05);
  border-color: #1A365D !important;
}

.fc-day-today {
  background: rgba(26, 54, 93, 0.1) !important;
  border: 2px solid #1A365D !important;
}

.fc-daygrid-day-number {
  padding: 8px !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  color: #1A365D;
}

.fc-day-today .fc-daygrid-day-number {
  background: #1A365D;
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Events in Month View */
.fc-event {
  border: none !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  margin: 2px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fc-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Week View */
.fc-timegrid-slot {
  height: 60px !important;
  border-top: 1px solid #F0F0F0 !important;
}

.fc-timegrid-slot-label {
  font-size: 0.75rem !important;
  color: #8E8E93;
  padding: 8px !important;
}

.fc-timegrid-axis {
  border-right: 2px solid #E0E0E0 !important;
}

/* Day View - Horizontal Timeline */
.fc-timegrid-body {
  border: none !important;
}

.fc-timegrid-col {
  border-right: 1px solid #F0F0F0 !important;
}

.fc-timegrid-event {
  border-radius: 8px !important;
  border: none !important;
  padding: 8px 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
}

.fc-timegrid-event:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
  z-index: 10;
}

/* Hour Markers in Day View */
.fc-timegrid-hour {
  border-top: 1px solid #E0E0E0 !important;
}

.fc-timegrid-hour .fc-timegrid-slot-label {
  border-top: 1px solid #E0E0E0 !important;
}

/* Time blocks visualization */
.fc-timegrid-slot-minor {
  border-top: none !important;
}

/* Now indicator */
.fc-timegrid-col-frame {
  position: relative;
}

.fc-day-timegrid .fc-timegrid-col:first-child .fc-timegrid-col-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #DC3545 0%, rgba(220, 53, 69, 0.3) 100%);
  z-index: 999;
}

/* Event Pills */
.fc-event-main {
  font-weight: 500;
  line-height: 1.4;
  white-space: normal !important;
}

.fc-event-time {
  font-weight: 600;
  margin-right: 4px;
}

/* More Events Link */
.fc-daygrid-more-link {
  font-weight: 500 !important;
  color: #1A365D !important;
  text-decoration: none !important;
  background: rgba(26, 54, 93, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.fc-daygrid-more-link:hover {
  background: rgba(26, 54, 93, 0.2);
}

/* Scrollbar for calendar */
.fc-scroller::-webkit-scrollbar {
  width: 8px;
}

.fc-scroller::-webkit-scrollbar-track {
  background: #F2F2F7;
}

.fc-scroller::-webkit-scrollbar-thumb {
  background: #C7C7CC;
  border-radius: 4px;
}

.fc-scroller::-webkit-scrollbar-thumb:hover {
  background: #8E8E93;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fc-toolbar {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  .fc-toolbar-title {
    font-size: 1.25rem !important;
  }
  
  #calendar-container {
    padding: 12px;
  }
  
  .fc-event {
    font-size: 0.7rem !important;
    padding: 3px 6px !important;
  }
}

/* Metrics Styles */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

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

.metric-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
}

/* Side Menu */
.side-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 299;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

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

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 280px;
  max-width: 80vw;
  background-color: #ffffff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: auto;
}

.side-menu.active {
  transform: translateX(0);
}

.side-menu-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1A365D;
  color: #ffffff;
  flex-shrink: 0;
}

.side-menu-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-menu {
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

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

.side-menu-content {
  flex: 1;
  padding: var(--spacing-md) 0;
  overflow-y: auto;
}

.side-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: #000000;
  text-decoration: none;
  transition: background-color var(--transition-fast);
  font-size: 1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.side-menu-item:hover {
  background-color: #f5f5f5;
}

.side-menu-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.side-menu-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: var(--spacing-md) var(--spacing-lg);
}

.side-menu-btn {
  color: var(--color-danger);
}

.side-menu-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Shift content when menu is open */
/* Shifting content when menu opens - DO NOT MOVE CONTENT */
.app-container {
  transition: none;
}

body.menu-open .app-container {
  transform: none;
}

/* Menu button in header */
.btn-menu {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 1.25rem;
  transition: background-color var(--transition-fast);
}

.btn-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.metric-value {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-accent);
}

.metric-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

.metrics-details {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

/* Journal Styles */
.journal-section {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.journal-entries {
  margin-top: var(--spacing-md);
}

.journal-entry {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  border-left: 3px solid var(--color-accent);
  background-color: var(--color-bg);
}

.journal-meta {
  margin-bottom: var(--spacing-xs);
}

.journal-text {
  white-space: pre-wrap;
  color: var(--color-text);
}

/* Modal Styles */
.modal-content {
  background-color: var(--color-surface) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border);
}

.modal-header {
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  color: var(--color-text) !important;
}

.modal-body {
  color: var(--color-text) !important;
}

.modal-body p {
  color: var(--color-text) !important;
}

.modal-body .form-label {
  color: var(--color-text) !important;
}

.modal-body .form-control,
.modal-body .form-select {
  background-color: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
  background-color: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.25rem rgba(0, 116, 217, 0.25);
}

.modal-body .form-text {
  color: var(--color-text-muted) !important;
}

.modal-footer {
  border-top: 1px solid var(--color-border);
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Form elements in dark theme */
@media (prefers-color-scheme: dark) {
  [data-theme="dark"] .modal-content,
  [data-theme="auto"] .modal-content {
    background-color: #1e1e1e !important;
  }
  
  [data-theme="dark"] .form-control,
  [data-theme="dark"] .form-select,
  [data-theme="auto"] .form-control,
  [data-theme="auto"] .form-select {
    background-color: #121212;
    color: #ffffff;
    border-color: #333333;
  }
}

.ai-chat-message {
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
    line-height: 1.4;
}

.ai-chat-message.ai {
    background-color: #f1f0f0;
    align-self: flex-start;
}

.ai-chat-message.user {
    background-color: #0d6efd;
    color: white;
    align-self: flex-end;
}

#ai-chat-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

