/*
 * Focus24 Cabinet - Modern Dashboard Styles
 * A sleek, glassmorphic design for the tiredness tracking dashboard
 */

/* ===========================
   CABINET LAYOUT
   =========================== */

.cabinet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

@media (max-width: 1024px) {
  .cabinet {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }
}

/* ===========================
   DASHBOARD CARDS
   =========================== */

.dashboard-card {
  background: var(--color-white);
  border-radius: var(--radius-3xl);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.04);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-accent, var(--color-primary)), var(--card-accent-end, var(--color-primary-light)));
  border-radius: var(--radius-5xl) var(--radius-5xl) 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-card:hover::before {
  opacity: 1;
}

/* Card Sizes - Row 1: Camera + Performance + Data = 12 */
.dashboard-card--camera {
  grid-column: span 4;
  min-height: auto;
  background: var(--color-white);
}

.dashboard-card--performance {
  grid-column: span 4;
  --card-accent: var(--color-success);
  --card-accent-end: var(--color-success-lime);
}

.dashboard-card--data {
  grid-column: span 4;
  --card-accent: var(--color-brand-orange);
  --card-accent-end: var(--color-warning);
}

/* Full width cards */
.dashboard-card--pomodoro {
  grid-column: span 12;
  --card-accent: var(--color-danger);
  --card-accent-end: var(--color-primary);
}

.dashboard-card--state {
  grid-column: span 12;
  --card-accent: var(--color-info-purple);
  --card-accent-end: var(--color-primary);
}

.dashboard-card--stats {
  grid-column: span 12;
}

@media (max-width: 1200px) {
  .dashboard-card--pomodoro { grid-column: span 12; }
  .dashboard-card--camera { grid-column: span 4; }
  .dashboard-card--performance { grid-column: span 4; }
  .dashboard-card--data { grid-column: span 4; }
  .dashboard-card--state { grid-column: span 12; }
  .dashboard-card--stats { grid-column: span 12; }
}

@media (max-width: 1024px) {
  .dashboard-card--pomodoro,
  .dashboard-card--performance,
  .dashboard-card--data,
  .dashboard-card--camera,
  .dashboard-card--state,
  .dashboard-card--stats {
    grid-column: span 1;
  }
}

/* ===========================
   CARD HEADER
   =========================== */

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-600);
  margin: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-title i {
  font-size: var(--font-size-body);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--card-accent, var(--color-gray-100));
  color: var(--color-white);
  flex-shrink: 0;
}

.card-title--performance i { background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%); }
.card-title--data i { background: linear-gradient(135deg, var(--color-brand-orange) 0%, var(--color-brand-orange-light) 100%); }
.card-title--advice i { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); }

.card-action {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: var(--radius-lg);
  color: var(--color-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.card-action:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}

/* ===========================
   PERFORMANCE METER
   =========================== */

.performance-display {
  text-align: center;
  padding: 8px 0;
}

.performance-value {
  font-size: var(--font-size-display);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin: 0 0 4px 0;
  transition: all 0.5s ease;
}

.performance-value.warning {
  background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-brand-orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.performance-value.danger {
  background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.performance-label {
  font-size: var(--font-size-body-sm);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.performance-bar-container {
  margin-top: 24px;
  padding: 0 8px;
}

.performance-bar {
  height: 8px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.performance-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-success) 0%, var(--color-success-lime) 100%);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
  position: relative;
}

.performance-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.performance-bar-fill.warning {
  background: linear-gradient(90deg, var(--color-warning) 0%, var(--color-brand-orange) 100%);
}

.performance-bar-fill.danger {
  background: linear-gradient(90deg, var(--color-error-coral) 0%, var(--color-error) 100%);
}

/* ===========================
   ADVICE CARD
   =========================== */

.advice-content {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-white) 100%);
  border-radius: var(--radius-4xl);
  padding: 20px;
  border-left: 4px solid var(--color-primary);
  min-height: 100px;
}

/* ===========================
   SIDEBAR CARDS
   =========================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-card {
  background: var(--color-white);
  border-radius: var(--radius-3xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.sidebar-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-gray-100);
}

.sidebar-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  color: var(--color-gray-600);
  margin: 0;
}

.sidebar-card__title i {
  font-size: var(--font-size-subhead);
}

.sidebar-card--advice .sidebar-card__title i {
  color: var(--color-primary);
}

.sidebar-card--tasks .sidebar-card__title i {
  color: var(--color-apple-indigo);
}

.sidebar-card__toggle {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-base);
  color: var(--color-gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-card__toggle:hover {
  background: var(--color-gray-100);
}

.sidebar-card__toggle i {
  transition: transform 0.3s ease;
}

.sidebar-card.collapsed .sidebar-card__toggle i {
  transform: rotate(180deg);
}

.sidebar-card.collapsed .sidebar-card__content {
  display: none;
}

.sidebar-card__content {
  padding: 16px;
}

/* Advice Card Specific */
.sidebar-card--advice {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-left: 3px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-card--advice .sidebar-card__header {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-card--advice .sidebar-card__content {
  padding-top: 12px;
}

.sidebar-card--advice .advice-text {
  font-size: var(--font-size-body);
  line-height: 1.6;
  margin: 0;
  color: var(--color-gray-700);
    white-space: pre-wrap;
}

.sidebar-card--advice .advice-text.empty {
  color: var(--color-gray-500);
  font-style: italic;
}

/* Multiple advice items */
.advice-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-gray-200);
  white-space: pre-wrap;
}

.advice-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.advice-item:first-child {
  padding-top: 0;
}

.advice-separator {
  color: var(--color-primary);
  font-weight: 600;
  margin: 0 2px;
}

.dark-mode .advice-separator {
  color: var(--color-primary-light);
}

.dark-mode .advice-item {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Tasks Card Specific */
.sidebar-card--tasks .sidebar-card__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dark mode */
.dark-mode .sidebar-card {
  background: var(--color-apple-bg-dark);
}

.dark-mode .sidebar-card__header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .sidebar-card__title {
  color: var(--color-gray-300);
}

.dark-mode .sidebar-card__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode .sidebar-card--advice {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.08) 0%, #1c1c1e 100%);
}

.dark-mode .sidebar-card--advice .advice-text {
  color: rgba(255, 255, 255, 0.8);
}

.dark-mode .sidebar-card--advice .advice-text.empty {
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 1024px) {
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    position: relative;
    top: 0;
    max-height: none;
  }

  .sidebar-card {
    flex: 1;
    min-width: 280px;
  }

  /* Cabinet wrapper responsive - stack columns on smaller screens */
  .cabinet-wrapper {
    flex-direction: column !important;
  }

  .cabinet-wrapper .sidebar {
    width: 100% !important;
    order: 2;
  }

  .cabinet-wrapper .cabinet {
    width: 100% !important;
    order: 1;
  }
}

.advice-text {
  font-size: var(--font-size-body-lg);
  line-height: 1.6;
  color: var(--color-gray-750);
  margin: 0;
}

.advice-text.empty {
  color: var(--color-gray-500);
  font-style: italic;
}

/* ===========================
   DATA CHART CARD
   =========================== */

.chart-container {
  position: relative;
  height: 140px;
  margin-top: 8px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===========================
   EXPORT SECTION
   =========================== */

.export-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-gray-200);
}

.btn--export {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-2xl);
  font-size: var(--font-size-body-lg);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(100, 217, 100, 0.3);
}

.btn--export:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 217, 100, 0.4);
}

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

.btn--export i {
  font-size: var(--font-size-title);
}

/* ===========================
   START SCREEN OVERLAY
   =========================== */

.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.start-screen__content {
  text-align: center;
  max-width: 480px;
  padding: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-7xl);
  backdrop-filter: blur(10px);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.start-screen__icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-6xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  font-size: var(--font-size-display);
  color: var(--color-white);
  box-shadow: 0 16px 48px rgba(0, 171, 255, 0.3);
}

.start-screen__title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 16px;
}

.start-screen__description {
  font-size: var(--font-size-subhead);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 32px;
}

.start-screen__permissions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.permission-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-caption);
}

.permission-item i {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-title);
}

/* ===========================
   MODERN BUTTON
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: var(--font-size-subhead);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-3xl);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(0, 171, 255, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 171, 255, 0.4);
}

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

.btn--large {
  padding: 20px 48px;
  font-size: var(--font-size-title);
  border-radius: var(--radius-4xl);
}

.btn--gradient {
  background: linear-gradient(135deg, var(--color-brand-pink) 0%, var(--color-brand-orange) 100%);
  box-shadow: 0 8px 24px rgba(233, 30, 99, 0.3);
}

.btn--gradient:hover {
  box-shadow: 0 12px 32px rgba(233, 30, 99, 0.4);
}

/* ===========================
   CAMERA PREVIEW
   =========================== */

.camera-preview {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border-radius: var(--radius-4xl);
  overflow: hidden;
  background: var(--color-gray-900);
  position: relative;
}

.camera-preview canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.camera-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--color-white);
  font-size: var(--font-size-body-sm);
}

.camera-status__dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* ===========================
   STATS MINI CARDS
   =========================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.stat-item {
  background: var(--color-gray-50);
  border-radius: var(--radius-2xl);
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: var(--color-gray-100);
}

.stat-value {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 4px;
}

.stat-label {
  font-size: var(--font-size-footnote);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
}

/* ===========================
   HIDE OLD ELEMENTS
   =========================== */

#what-i-see {
  display: none;
}

/* ===========================
   ANIMATIONS
   =========================== */

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

.dashboard-card {
  animation: cardAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-card:nth-child(4) { animation-delay: 0.4s; }
.dashboard-card:nth-child(5) { animation-delay: 0.5s; }
.dashboard-card:nth-child(6) { animation-delay: 0.6s; }

/* ===========================
   STATE SCORING CARD
   =========================== */

.state-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

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

.state-indicator {
  background: var(--color-gray-50);
  border-radius: var(--radius-xl);
  padding: 10px 8px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.state-indicator::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--state-color, var(--color-gray-300));
  transition: all 0.3s ease;
}

.state-indicator:hover {
  background: var(--color-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.state-indicator__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-lg);
  background: var(--state-color, var(--color-gray-300));
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-size: var(--font-size-body-sm);
  transition: all 0.3s ease;
}

.state-indicator__value {
  font-size: var(--font-size-title);
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 2px;
  line-height: 1;
}

.state-indicator__label {
  font-size: var(--font-size-micro);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--color-gray-500);
  margin: 0 0 4px;
}

.state-indicator__status {
  font-size: var(--font-size-micro);
  font-weight: 500;
  color: var(--state-color, var(--color-gray-600));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.state-indicator__status i {
  font-size: var(--font-size-footnote);
}

/* State colors */
.state-indicator.excellent {
  --state-color: var(--color-success);
}

.state-indicator.good {
  --state-color: var(--color-success-dark);
}

.state-indicator.neutral {
  --state-color: var(--color-primary);
}

.state-indicator.warning {
  --state-color: var(--color-warning);
}

.state-indicator.danger {
  --state-color: var(--color-error-coral);
}

.state-indicator.critical {
  --state-color: var(--color-error);
}

/* ===========================
   HEART RATE (rPPG) DISPLAY
   =========================== */

#state-heart-rate .state-indicator__icon {
  background: linear-gradient(135deg, #ff3366 0%, #ff6b8a 100%);
}

#state-heart-rate .state-indicator__value {
  font-variant-numeric: tabular-nums;
  transition: text-shadow 0.3s ease;
}

#state-heart-rate .state-indicator__value.pulse {
  animation: hr-pulse-glow 0.3s ease;
}

@keyframes hr-pulse-glow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 20px rgba(255, 51, 102, 0.6); }
}

.hr-confidence {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  text-align: center;
}

.hr-confidence.high {
  color: var(--color-success);
}

.hr-confidence.medium {
  color: var(--color-warning);
}

.hr-confidence.low {
  color: var(--color-error-coral);
}

/* ===========================
   OVERALL STATE DISPLAY
   =========================== */

.overall-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-850) 100%);
  border-radius: var(--radius-2xl);
  margin-bottom: 12px;
}

.overall-state__circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(
    var(--overall-color, var(--color-success)) calc(var(--overall-value, 100) * 1%),
    var(--color-gray-700) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.overall-state__circle::before {
  content: '';
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-gray-900);
}

.overall-state__value {
  position: relative;
  z-index: 1;
  font-size: var(--font-size-title);
  font-weight: 700;
  color: var(--color-white);
}

.overall-state__info {
  flex: 1;
  min-width: 0;
}

.overall-state__title {
  font-size: var(--font-size-footnote);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
  margin: 0 0 4px;
}

.overall-state__label {
  font-size: var(--font-size-title);
  font-weight: 600;
  color: var(--color-white);
  margin: 0 0 6px;
}

.overall-state__recommendation {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--font-size-caption);
  color: var(--color-gray-400);
  line-height: 1.4;
}

.overall-state__recommendation i {
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===========================
   MINI STATE BAR (for stats card)
   =========================== */

.state-mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.state-mini-bar:last-child {
  margin-bottom: 0;
}

.state-mini-bar__label {
  font-size: var(--font-size-footnote);
  color: var(--color-gray-600);
  width: 70px;
  flex-shrink: 0;
}

.state-mini-bar__track {
  flex: 1;
  height: 6px;
  background: var(--color-gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.state-mini-bar__fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 2s ease, background 1s ease;
}

.state-mini-bar__fill.alertness { background: var(--color-success); }
.state-mini-bar__fill.focus { background: var(--color-primary); }
.state-mini-bar__fill.fatigue { background: var(--color-error-coral); }
.state-mini-bar__fill.stress { background: var(--color-warning); }

.state-mini-bar__value {
  font-size: var(--font-size-footnote);
  font-weight: 600;
  color: var(--color-gray-700);
  width: 35px;
  text-align: right;
}

/* ===========================
   PATTERN DETECTION CARD
   =========================== */

.dashboard-card--patterns {
  grid-column: span 6;
  --card-accent: var(--color-apple-purple);
  --card-accent-end: var(--color-apple-blue);
}

@media (max-width: 1200px) {
  .dashboard-card--patterns {
    grid-column: span 12;
  }
}

@media (max-width: 1024px) {
  .dashboard-card--patterns {
    grid-column: span 1;
  }
}

.pattern-current-state {
  background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-850) 100%);
  border-radius: var(--radius-4xl);
  padding: 20px;
  margin-bottom: 20px;
}

.pattern-state-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pattern-state-display i {
  font-size: var(--font-size-h2);
}

.pattern-state-display span {
  font-size: var(--font-size-title-lg);
  font-weight: 600;
  color: var(--color-gray-300);
}

.pattern-meta {
  display: flex;
  gap: 24px;
  font-size: var(--font-size-body-sm);
  color: var(--color-gray-500);
}

.pattern-meta strong {
  color: var(--color-gray-300);
}

.pattern-section-label {
  font-size: var(--font-size-caption);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
  margin: 0 0 12px;
}

.pattern-trends-section {
  margin-bottom: 24px;
}

.pattern-trends {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: var(--font-size-body);
  font-weight: 500;
}

.pattern-learning-section {
  margin-bottom: 24px;
}

.pattern-learning-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pattern-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-body-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

.pattern-btn:hover {
  transform: translateY(-2px);
}

.pattern-btn--focused {
  background: rgba(48, 209, 88, 0.15);
  color: var(--color-apple-green);
}

.pattern-btn--focused:hover {
  background: rgba(48, 209, 88, 0.25);
}

.pattern-btn--tired {
  background: rgba(255, 149, 0, 0.15);
  color: var(--color-apple-orange);
}

.pattern-btn--tired:hover {
  background: rgba(255, 149, 0, 0.25);
}

.pattern-btn--stressed {
  background: rgba(255, 55, 95, 0.15);
  color: var(--color-accent);
}

.pattern-btn--stressed:hover {
  background: rgba(255, 55, 95, 0.25);
}

.pattern-btn--relaxed {
  background: rgba(90, 200, 250, 0.15);
  color: var(--color-apple-cyan);
}

.pattern-btn--relaxed:hover {
  background: rgba(90, 200, 250, 0.25);
}

.pattern-feedback {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-body-sm);
}

.pattern-feedback.success {
  background: rgba(48, 209, 88, 0.15);
  color: var(--color-apple-green);
}

.pattern-feedback.error {
  background: rgba(255, 55, 95, 0.15);
  color: var(--color-accent);
}

.pattern-discovered-section {
  margin-bottom: 20px;
}

.pattern-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pattern-section-header .pattern-section-label {
  margin: 0;
}

.pattern-btn-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-caption);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-primary);
  color: var(--color-white);
}

.pattern-btn-small:hover {
  background: var(--color-primary-dark);
}

.discovered-states {
  min-height: 40px;
}

.discovered-states-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.discovered-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-gray-50);
  border-radius: var(--radius-xl);
  transition: all 0.2s ease;
}

.discovered-state:hover {
  background: var(--color-gray-100);
}

.discovered-state i {
  font-size: var(--font-size-title);
}

.discovered-state .state-label {
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-gray-800);
}

.discovered-state .state-confidence {
  font-size: var(--font-size-caption);
  color: var(--color-gray-500);
  margin-left: 4px;
}

.pattern-export-section {
  padding-top: 16px;
  border-top: 1px solid var(--color-gray-200);
}

.btn--small {
  padding: 10px 20px;
  font-size: var(--font-size-body-sm);
}

/* ===========================
   NECK STRAIN TRACKING CARD
   =========================== */

.dashboard-card--neck-strain {
  grid-column: span 6;
  --card-accent: var(--color-accent);
  --card-accent-end: var(--color-apple-orange);
}

@media (max-width: 1200px) {
  .dashboard-card--neck-strain {
    grid-column: span 12;
  }
}

@media (max-width: 1024px) {
  .dashboard-card--neck-strain {
    grid-column: span 1;
  }
}

.section-label-small {
  font-size: var(--font-size-footnote);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
  margin: 0 0 12px;
}

/* Risk Level Indicator */
.neck-risk-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-gray-50);
  border-radius: var(--radius-2xl);
  margin-bottom: 20px;
}

.neck-duration-section {
  padding: 12px 16px;
  background: rgba(255, 149, 0, 0.1);
  border-left: 3px solid var(--color-orange);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

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

.duration-item {
  font-size: 13px;
  color: var(--color-gray-700);
  font-weight: 500;
}

.neck-risk-indicator {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.neck-risk-indicator.risk-minimal { background: var(--color-apple-green); }
.neck-risk-indicator.risk-low { background: #5ac8fa; }
.neck-risk-indicator.risk-moderate { background: #ff9500; }
.neck-risk-indicator.risk-high { background: var(--color-accent); }
.neck-risk-indicator.risk-critical { background: var(--color-accent); animation: pulse-critical 1s infinite; }

@keyframes pulse-critical {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.neck-risk-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.neck-risk-label-text {
  font-size: var(--font-size-caption);
  color: var(--color-gray-500);
}

.neck-risk-info strong {
  font-size: var(--font-size-title);
  color: var(--color-gray-900);
}

/* 3CC Compartment Visualization */
.compartment-section {
  margin-bottom: 24px;
}

.compartment-bar-container {
  margin-bottom: 16px;
}

.compartment-bar {
  display: flex;
  height: 24px;
  background: var(--color-gray-200);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: 8px;
}

.compartment-fill {
  height: 100%;
  transition: width 1.5s ease;
}

.compartment-fill.resting { background: var(--color-apple-green); }
.compartment-fill.active { background: var(--color-apple-blue); }
.compartment-fill.fatigued { background: var(--color-accent); }

.compartment-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: var(--font-size-footnote);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-gray-600);
}

.legend-item i { font-size: var(--font-size-icon); }
.legend-item.resting i { color: var(--color-apple-green); }
.legend-item.active i { color: var(--color-apple-blue); }
.legend-item.fatigued i { color: var(--color-accent); }

.fatigue-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.fatigue-stat {
  background: var(--color-gray-50);
  border-radius: var(--radius-xl);
  padding: 12px;
  text-align: center;
}

.fatigue-stat-label {
  display: block;
  font-size: var(--font-size-footnote);
  color: var(--color-gray-500);
  margin-bottom: 4px;
}

.fatigue-stat strong {
  font-size: var(--font-size-subhead);
  color: var(--color-gray-900);
}

/* Current Posture */
.posture-section {
  margin-bottom: 24px;
}

.posture-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.posture-item {
  background: var(--color-gray-50);
  border-radius: var(--radius-xl);
  padding: 12px;
  text-align: center;
}

.posture-label {
  display: block;
  font-size: var(--font-size-footnote);
  color: var(--color-gray-500);
  margin-bottom: 4px;
}

.posture-value {
  font-size: var(--font-size-title-lg);
  font-weight: 600;
  transition: color 1.5s ease;
}

.posture-value.good { color: var(--color-apple-green); }
.posture-value.low { color: var(--color-apple-cyan); }
.posture-value.moderate { color: var(--color-apple-orange); }
.posture-value.high { color: var(--color-accent); }
.posture-value.critical { color: var(--color-accent); font-weight: 700; }

/* Muscle Strain Visualization */
.muscle-strain-section {
  margin-bottom: 20px;
}

.muscle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

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

.muscle-side, .muscle-center {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.muscle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.muscle-label {
  font-size: var(--font-size-footnote);
  color: var(--color-gray-600);
  width: 90px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.muscle-label.most-strained {
  color: var(--color-accent);
  font-weight: 600;
}

.muscle-bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.muscle-bar-fill {
  height: 100%;
  background: var(--color-apple-green);
  border-radius: var(--radius-md);
  transition: width 2s ease, background 1s ease;
  width: 0%;
}

.asymmetry-indicator {
  text-align: center;
  margin-top: 12px;
  font-size: var(--font-size-body-sm);
  color: var(--color-gray-600);
}

.asymmetry-indicator strong {
  color: var(--color-gray-900);
}

/* Calibrate Section */
.neck-calibrate-section {
  padding-top: 16px;
  border-top: 1px solid var(--color-gray-200);
  text-align: center;
}

.btn--secondary {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-200);
}

.btn--secondary:hover {
  background: var(--color-gray-200);
  color: var(--color-gray-900);
}

/* ===========================
   DARK MODE TOGGLE BUTTON
   =========================== */

.dark-mode-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 100%);
  color: #1d1d1f;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-body);
  font-weight: 600;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 0 0 0 rgba(10, 132, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: theme-toggle-pulse 3s ease-in-out infinite;
}

@keyframes theme-toggle-pulse {
  0%, 100% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.15),
      0 0 0 0 rgba(10, 132, 255, 0.4);
  }
  50% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.15),
      0 0 0 8px rgba(10, 132, 255, 0);
  }
}

.dark-mode-toggle:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 0 0 0 rgba(10, 132, 255, 0);
  animation: none;
  border-color: var(--color-primary);
}

.dark-mode-toggle__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9500 0%, #ffcc00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-body);
  color: white;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.4);
}

.dark-mode-toggle .icon-sun,
.dark-mode-toggle .icon-moon {
  position: absolute;
  transition: all 0.4s ease;
}

.dark-mode-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.dark-mode-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.dark-mode-toggle__label {
  white-space: nowrap;
}

.dark-mode-toggle__label::after {
  content: 'Тёмная тема';
}

/* ===========================
   DARK MODE CABINET STYLES
   =========================== */

/* Body background for dark mode */
body.dark-mode {
  background: #0e0e10;
}

.dark-mode .header-spacer {
  background: #0e0e10;
}

.dark-mode .cabinet {
  background: #0e0e10;
}

.dark-mode .dashboard-card {
  background: var(--color-apple-bg-dark);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode .dashboard-card:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

.dark-mode .dashboard-card--camera {
  background: var(--color-apple-bg-dark);
}

/* Dark mode toggle button state */
.dark-mode .dark-mode-toggle {
  background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 0 rgba(94, 92, 230, 0.4);
  animation: theme-toggle-pulse-dark 3s ease-in-out infinite;
}

@keyframes theme-toggle-pulse-dark {
  0%, 100% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 0 0 rgba(94, 92, 230, 0.4);
  }
  50% {
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.4),
      0 0 0 8px rgba(94, 92, 230, 0);
  }
}

.dark-mode .dark-mode-toggle:hover {
  border-color: var(--color-apple-indigo);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 0 rgba(94, 92, 230, 0);
  animation: none;
}

.dark-mode .dark-mode-toggle__icon {
  background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
  box-shadow: 0 2px 8px rgba(94, 92, 230, 0.5);
}

.dark-mode .dark-mode-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.dark-mode .dark-mode-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.dark-mode .dark-mode-toggle__label::after {
  content: 'Светлая тема';
}

/* Card backgrounds */
.dark-mode .stat-item,
.dark-mode .state-indicator,
.dark-mode .posture-item,
.dark-mode .fatigue-stat,
.dark-mode .neck-risk-section,
.dark-mode .discovered-state {
  background: #2c2c2e;
}

.dark-mode .stat-item:hover,
.dark-mode .state-indicator:hover,
.dark-mode .discovered-state:hover {
  background: #3a3a3c;
}

.dark-mode .state-indicator:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Text colors */
.dark-mode .card-title {
  color: #a1a1a6;
}

.dark-mode .performance-label,
.dark-mode .stat-label,
.dark-mode .state-indicator__label,
.dark-mode .posture-label,
.dark-mode .fatigue-stat-label,
.dark-mode .state-mini-bar__label,
.dark-mode .pattern-section-label,
.dark-mode .section-label-small,
.dark-mode .legend-item,
.dark-mode .muscle-label,
.dark-mode .asymmetry-indicator,
.dark-mode .neck-risk-label-text {
  color: #8e8e93;
}

.dark-mode .stat-value,
.dark-mode .state-indicator__value,
.dark-mode .fatigue-stat strong,
.dark-mode .neck-risk-info strong {
  color: #f5f5f7;
}

.dark-mode .state-indicator__status {
  color: #d1d1d6;
}

.dark-mode .state-mini-bar__value {
  color: #d1d1d6;
}

.dark-mode .asymmetry-indicator strong {
  color: #f5f5f7;
}

/* Advice card */
.dark-mode .advice-content {
  background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
  border-left-color: var(--color-primary);
}

.dark-mode .advice-text {
  color: #d1d1d6;
}

.dark-mode .advice-text.empty {
  color: #8e8e93;
}

/* Progress bars and tracks */
.dark-mode .performance-bar,
.dark-mode .state-mini-bar__track,
.dark-mode .muscle-bar-track,
.dark-mode .compartment-bar {
  background: #3a3a3c;
}

/* Pattern card dark sections */
.dark-mode .pattern-current-state {
  background: linear-gradient(135deg, #000000 0%, #1c1c1e 100%);
}

.dark-mode .pattern-meta {
  color: #8e8e93;
}

.dark-mode .pattern-meta strong {
  color: #d1d1d6;
}

/* Pattern buttons */
.dark-mode .pattern-btn {
  background: #3a3a3c;
  color: #d1d1d6;
}

.dark-mode .pattern-btn--focused {
  background: rgba(48, 209, 88, 0.2);
  color: var(--color-apple-green);
}

.dark-mode .pattern-btn--tired {
  background: rgba(255, 149, 0, 0.2);
  color: var(--color-apple-orange);
}

.dark-mode .pattern-btn--stressed {
  background: rgba(255, 55, 95, 0.2);
  color: var(--color-accent);
}

.dark-mode .pattern-btn--relaxed {
  background: rgba(90, 200, 250, 0.2);
  color: var(--color-apple-cyan);
}

/* Buttons */
.dark-mode .btn--secondary {
  background: #3a3a3c;
  color: #d1d1d6;
  border-color: #48484a;
}

.dark-mode .btn--secondary:hover {
  background: #48484a;
  color: #f5f5f7;
}

.dark-mode .btn--ghost {
  background: transparent;
  color: #8e8e93;
  border-color: #3a3a3c;
}

.dark-mode .btn--ghost:hover {
  background: #2c2c2e;
  color: #d1d1d6;
}

/* Export section */
.dark-mode .export-section,
.dark-mode .pattern-export-section,
.dark-mode .neck-calibrate-section {
  border-top-color: #3a3a3c;
}

/* Card action buttons */
.dark-mode .card-action {
  color: #8e8e93;
}

.dark-mode .card-action:hover {
  background: #3a3a3c;
  color: #f5f5f7;
}

/* Overall state display (already dark) */
.dark-mode .overall-state {
  background: linear-gradient(135deg, #000000 0%, #1c1c1e 100%);
}

.dark-mode .overall-state__circle::before {
  background: #000000;
}

/* History card specific */
.dark-mode .dashboard-card--history {
  background: linear-gradient(135deg, rgba(90, 200, 250, 0.08) 0%, rgba(10, 132, 255, 0.08) 100%);
}

.dark-mode .history-stat {
  background: #2c2c2e;
}

.dark-mode .history-mini-chart {
  background: #2c2c2e;
}

.dark-mode .history-session-item {
  background: #2c2c2e;
  border-color: #3a3a3c;
}

.dark-mode .history-session-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.25);
}

.dark-mode .history-session-item__date {
  color: #f5f5f7;
}

.dark-mode .history-session-item__duration {
  color: #8e8e93;
}

.dark-mode .history-empty {
  color: #636366;
}

/* Scroll bars for dark mode */
.dark-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
  background: var(--color-apple-bg-dark);
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: #3a3a3c;
  border-radius: var(--radius-md);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #48484a;
}

/* Start screen */
.dark-mode .start-screen__title {
  color: #ffffff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .dark-mode-toggle {
    bottom: 16px;
    right: 16px;
    height: 44px;
    padding: 0 16px 0 12px;
    font-size: var(--font-size-body-sm);
    gap: 8px;
  }

  .dark-mode-toggle__icon {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-caption);
  }
}

@media (max-width: 480px) {
  .dark-mode-toggle {
    padding: 0 12px;
  }

  .dark-mode-toggle__label {
    display: none;
  }

  .dark-mode-toggle__icon {
    width: 28px;
    height: 28px;
    font-size: var(--font-size-body);
  }

  /* Cabinet wrapper - ensure proper stacking on small mobile */
  .cabinet-wrapper {
    padding: 12px !important;
    gap: 12px !important;
  }

  .cabinet-wrapper .cabinet {
    padding: 8px !important;
  }

  .cabinet-wrapper .sidebar {
    gap: 10px !important;
  }
}

/* ===========================
   FACE FITNESS PANEL
   =========================== */

/* Face Fitness Exercise Panel */
.face-fitness-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: var(--color-white);
  border-radius: var(--radius-3xl);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.face-fitness-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

/* Dark mode support */
[data-theme="dark"] .face-fitness-panel {
  background: var(--color-gray-900);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Header */
.ff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white;
}

.ff-title {
  font-weight: 600;
  font-size: var(--font-size-body);
}

.ff-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-close-btn:hover {
  opacity: 1;
}

/* Content */
.ff-content {
  padding: 20px;
}

.ff-instruction {
  font-size: var(--font-size-lg);
  font-weight: 500;
  text-align: center;
  margin-bottom: 20px;
  min-height: 54px;
  color: var(--color-gray-900);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .ff-instruction {
  color: var(--color-gray-100);
}

/* Progress Bar */
.ff-progress-container {
  height: 8px;
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 16px;
}

[data-theme="dark"] .ff-progress-container {
  background: var(--color-gray-800);
}

.ff-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success), var(--color-success-lime));
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
  width: 0%;
}

/* Validation Feedback */
.ff-validation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--color-gray-50);
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .ff-validation {
  background: var(--color-gray-800);
}

.ff-validation.valid {
  background: rgba(39, 174, 96, 0.1);
  color: var(--color-success);
}

[data-theme="dark"] .ff-validation.valid {
  background: rgba(39, 174, 96, 0.2);
}

.ff-validation.invalid {
  background: rgba(231, 76, 60, 0.1);
  color: var(--color-danger);
}

[data-theme="dark"] .ff-validation.invalid {
  background: rgba(231, 76, 60, 0.2);
}

.ff-validation-icon {
  font-size: var(--font-size-lg);
}

.ff-validation-text {
  font-size: var(--font-size-body-sm);
  font-weight: 500;
}

/* Step Counter */
.ff-step-counter {
  text-align: center;
  font-size: var(--font-size-caption);
  color: var(--color-gray-600);
}

[data-theme="dark"] .ff-step-counter {
  color: var(--color-gray-400);
}

/* Footer */
.ff-footer {
  padding: 12px 16px;
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

[data-theme="dark"] .ff-footer {
  background: var(--color-gray-800);
  border-top: 1px solid var(--color-gray-700);
}

.ff-evidence {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
}

[data-theme="dark"] .ff-evidence {
  color: var(--color-gray-400);
}

/* ===========================
   EXERCISE SUGGESTION TOAST
   =========================== */

.exercise-suggestion {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 90%;
}

.exercise-suggestion.hidden {
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
}

[data-theme="dark"] .exercise-suggestion {
  background: var(--color-gray-900);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.suggestion-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

#suggestion-text {
  font-size: var(--font-size-body);
  color: var(--color-gray-900);
  flex: 1;
  min-width: 200px;
  text-align: center;
}

[data-theme="dark"] #suggestion-text {
  color: var(--color-gray-100);
}

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

.suggestion-actions .btn {
  padding: 8px 16px;
  font-size: var(--font-size-body-sm);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.suggestion-actions .btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white;
}

.suggestion-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.suggestion-actions .btn-secondary {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

[data-theme="dark"] .suggestion-actions .btn-secondary {
  background: var(--color-gray-700);
  color: var(--color-gray-300);
}

.suggestion-actions .btn-secondary:hover {
  background: var(--color-gray-200);
}

[data-theme="dark"] .suggestion-actions .btn-secondary:hover {
  background: var(--color-gray-600);
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
  .face-fitness-panel {
    width: calc(100% - 40px);
    max-width: 360px;
    right: 20px;
    left: 20px;
    margin: 0 auto;
  }

  .exercise-suggestion {
    bottom: 80px;
    width: calc(100% - 40px);
    max-width: 360px;
  }

  .suggestion-content {
    flex-direction: column;
    gap: 12px;
  }

  #suggestion-text {
    min-width: 100%;
  }

  .suggestion-actions {
    width: 100%;
  }

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

@media (max-width: 480px) {
  .face-fitness-panel {
    width: calc(100% - 24px);
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .ff-content {
    padding: 16px;
  }

  .ff-instruction {
    font-size: var(--font-size-body);
    min-height: 48px;
  }

  .exercise-suggestion {
    bottom: 60px;
    width: calc(100% - 24px);
  }
}

/* ===========================
   UI MODE TOGGLE (Simple / Expert)
   =========================== */

.mode-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 100%);
  color: #1d1d1f;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-body);
  font-weight: 600;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    0 0 0 0 rgba(94, 92, 230, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-toggle:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-color: var(--color-apple-indigo);
}

.mode-toggle__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-body);
  color: white;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(94, 92, 230, 0.4);
}

.mode-toggle .icon-simple,
.mode-toggle .icon-expert {
  position: absolute;
  transition: all 0.4s ease;
}

/* Simple mode state (default for new users) */
.mode-toggle.simple .icon-simple {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.mode-toggle.simple .icon-expert {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.mode-toggle.simple .mode-toggle__icon {
  background: linear-gradient(135deg, #30d158 0%, #5ac8fa 100%);
  box-shadow: 0 2px 8px rgba(48, 209, 88, 0.4);
}

/* Expert mode state */
.mode-toggle.expert .icon-simple {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.mode-toggle.expert .icon-expert {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.mode-toggle.expert .mode-toggle__icon {
  background: linear-gradient(135deg, #5e5ce6 0%, #bf5af2 100%);
  box-shadow: 0 2px 8px rgba(94, 92, 230, 0.4);
}

.mode-toggle__label {
  white-space: nowrap;
}

/* Dark mode support */
.dark-mode .mode-toggle {
  background: linear-gradient(135deg, #2c2c2e 0%, #1c1c1e 100%);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dark-mode .mode-toggle:hover {
  border-color: var(--color-apple-indigo);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .mode-toggle {
    bottom: 16px;
    left: 16px;
    height: 44px;
    padding: 0 16px 0 12px;
    font-size: var(--font-size-body-sm);
    gap: 8px;
  }

  .mode-toggle__icon {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-caption);
  }
}

@media (max-width: 480px) {
  .mode-toggle {
    padding: 0 12px;
  }

  .mode-toggle__label {
    display: none;
  }

  .mode-toggle__icon {
    width: 28px;
    height: 28px;
    font-size: var(--font-size-body);
  }
}

/* ===========================
   SIMPLE MODE - Hide Expert Elements
   =========================== */

body.simple-mode .expert-only {
  display: none !important;
}

/* Show simple-only elements only in simple mode */
.simple-only {
  display: none !important;
}

body.simple-mode .simple-only {
  display: flex !important;
}

/* Adjust grid layout when expert cards are hidden */
body.simple-mode .dashboard-card--patterns,
body.simple-mode .dashboard-card--data {
  display: none !important;
}

/* Make state-grid display expert-only wrapper inline when in expert mode */
.state-grid .expert-only {
  display: contents;
}

body.simple-mode .state-grid .expert-only {
  display: none !important;
}

/* Fix stats grid in simple mode - show remaining items centered */
body.simple-mode .stats-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* Simple PiP promo - compact view */
.pip-promo__simple {
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-body-sm);
  color: var(--color-gray-600);
  flex: 1;
}

.pip-promo__simple i {
  color: var(--color-primary);
}

.dark-mode .pip-promo__simple {
  color: var(--color-gray-400);
}

/* Compact pip-promo in simple mode */
body.simple-mode .pip-promo {
  padding: 12px 16px;
}

/* ===========================
   HEAD POSITION CALIBRATION
   =========================== */

.calibration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.calibration-overlay.visible {
  opacity: 1;
}

.calibration-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 90vw;
}

.calibration-canvas {
  border-radius: var(--radius-4xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.1);
  max-width: 100%;
  max-height: 70vh;
}

.calibration-message {
  text-align: center;
  animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.calibration-title {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 8px;
}

.calibration-subtitle {
  font-size: var(--font-size-subhead);
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

.calibration-progress {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.calibration-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), #00ff88);
  border-radius: 2px;
  transition: width 0.1s ease;
}

.calibration-actions {
  margin-top: 16px;
}

.calibration-skip-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
  padding: 12px 24px;
  border-radius: var(--radius-3xl);
  font-size: var(--font-size-body);
  cursor: pointer;
  transition: all 0.2s ease;
}

.calibration-skip-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calibration-canvas {
    max-height: 50vh;
    border-radius: var(--radius-3xl);
  }

  .calibration-title {
    font-size: var(--font-size-h3);
  }

  .calibration-subtitle {
    font-size: var(--font-size-body);
  }

  .calibration-progress {
    width: 160px;
  }
}

/*# sourceMappingURL=cabinet.css-6b3256433fbe0b38e49dcdd3f4ec52b7abf3c975f43e5c651ddf8a177d9ffcfc.map */
