/**
 * frost.css - ShangriLa Frost-tema
 *
 * Inspirerat av Omarchy Beyondlight Frost-teman
 * Fokus på klarhet, harmoni och lugn
 */

:root {
  /* Färgpalett - Frostglow Light inspirerad */
  --bg-primary: #f0f8ff;        /* Ice crystal white */
  --bg-secondary: #e8f4f8;      /* Lighter frost */
  --bg-card: #ffffff;           /* Pure white cards */

  --fg-primary: #0a0f14;        /* Deep blue-black */
  --fg-secondary: #2d3748;      /* Muted dark */
  --fg-muted: #718096;          /* Muted gray */

  --accent-primary: #4a9eff;    /* Glacier blue */
  --accent-hover: #3a8eef;      /* Darker glacier */

  --success: #50c878;           /* Aurora green */
  --warning: #ffd700;           /* Gold */
  --error: #ff6b6b;             /* Warm coral */
  --info: #64b5f6;              /* Light blue */

  --border-light: rgba(74, 158, 255, 0.2);
  --border-medium: rgba(74, 158, 255, 0.4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

  /* Typography */
  --font-family: 'Noto Sans', 'Source Sans 3', 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

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

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions - optimized for performance */
  --transition-fast: 100ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 200ms ease;

  /* ========== SHANGRILA SPECIFIC CONFIGURATION ========== */

  /* Calendar specific */
  --calendar-day-number-size: 1.25rem;
  --calendar-day-min-height: 100px;
  --calendar-week-number-size: 0.75rem;

  /* Time blocks */
  --time-block-height: 24px;
  --time-block-font-size: 0.7rem;
  --time-block-border-radius: 4px;

  /* Child chips */
  --child-chip-name-size: 0.875rem;
  --child-chip-details-size: 0.7rem;
  --child-chip-height: 60px;

  /* Template view */
  --template-header-title-size: 0.85rem;
  --template-header-text-size: 0.75rem;
  --template-week-header-size: 0.75rem;
  --template-btn-size: 0.75rem;
  --template-day-size: 0.75rem;
  --template-pool-title-size: 0.85rem;
  --template-instruction-size: 0.75rem;

  /* Navigation & Headers */
  --nav-title-size: 1.25rem;
  --nav-btn-size: 0.875rem;
  --tab-btn-size: 0.875rem;

  /* Statistics */
  --stat-label-size: 0.75rem;
  --stat-value-size: 1.5rem;

  /* Groups view */
  --group-card-title-size: 0.85rem;
  --group-instruction-size: 0.75rem;
  --group-label-size: 0.75rem;
  --group-select-size: 0.85rem;
  --group-btn-size: 0.85rem;
  --group-child-info-size: 0.75rem;

  /* Colors - ShangriLa specific */
  --week-v1-color: #FF6B9D;
  --week-v2-color: #4ECDC4;
  --week-v3-color: #95E1D3;
  --week-v4-color: #FFE66D;

  --weekend-bg: rgba(255, 107, 157, 0.1);
  --holiday-bg: rgba(255, 107, 107, 0.15);
  --today-border: #4a9eff;
  --other-month-opacity: 0.5;
}

/* Dark mode support (för framtiden) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a2b38;
    --bg-secondary: #243444;
    --bg-card: #2a3f52;
    --fg-primary: #f0f8ff;
    --fg-secondary: #cbd5e0;
    --fg-muted: #a0aec0;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--fg-primary);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl);
}

.header {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.header-subtitle {
  font-size: var(--font-size-sm);
  color: var(--fg-muted);
  margin-top: var(--spacing-xs);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--fg-primary);
}

.card-body {
  color: var(--fg-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--border-medium);
}

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

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

.btn-success:hover {
  background: #45b36a;
}

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

.btn-danger:hover {
  background: #e55a5a;
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--fg-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Sort Controls */
.sort-controls {
  margin-bottom: var(--spacing-md);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.sort-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--fg-secondary);
  margin: 0;
}

.sort-dropdown {
  width: auto;
  min-width: 200px;
  font-size: var(--font-size-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-dropdown:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.sort-dropdown:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

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

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

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

@media (max-width: 1024px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.badge-success {
  background: rgba(80, 200, 120, 0.2);
  color: var(--success);
  border: 1px solid rgba(80, 200, 120, 0.3);
}

.badge-warning {
  background: rgba(255, 215, 0, 0.2);
  color: #d4af37;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-error {
  background: rgba(255, 107, 107, 0.2);
  color: var(--error);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.badge-info {
  background: rgba(100, 181, 246, 0.2);
  color: var(--info);
  border: 1px solid rgba(100, 181, 246, 0.3);
}

/* Progress Bar */
.progress {
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
}

.progress-bar {
  height: 100%;
  background: var(--accent-primary);
  transition: width var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: white;
}

.progress-bar.success {
  background: var(--success);
}

.progress-bar.warning {
  background: var(--warning);
}

.progress-bar.error {
  background: var(--error);
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--spacing-sm);
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--spacing-lg);
}

.tab {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--fg-primary);
}

.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Stats */
.stats {
  display: flex;
  gap: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-xs);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--fg-primary);
}

/* Utility Classes */
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-muted { color: var(--fg-muted); }
.text-success { color: var(--success); }
.text-warning { color: #d4af37; }
.text-error { color: var(--error); }

.hidden { display: none !important; }

/* Animations - simplified for performance */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  animation: fadeIn 200ms ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--fg-primary);
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.btn-close:hover {
  background: var(--bg-secondary);
  color: var(--fg-primary);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-light);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--fg-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Template Month Selection */
.template-apply-section {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.template-apply-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: var(--spacing-md);
}

.template-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.template-month-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.template-month-option:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
  transform: translateY(-1px);
}

.template-month-option input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.template-month-option label {
  cursor: pointer;
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--fg-primary);
  flex: 1;
}

.template-month-option.selected {
  border-color: var(--accent-primary);
  background: rgba(74, 158, 255, 0.05);
}
