:root {
  --turquoise: #00d4aa;
  --gold: #ffd700;
  --dark: #0a0a0a;
  --dark-card: #141414;
  --dark-elevated: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --success: #00d4aa;
  --warning: #ffd700;
  --danger: #ff4444;
  --border: #2a2a2a;
  --radius: 12px;
  --radius-sm: 8px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.2s ease;
}

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

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

body {
  font-family: var(--font-family);
  background: var(--dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--dark-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--turquoise);
}

.navbar-brand .icon {
  font-size: 1.5rem;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 60px;
  left: -280px;
  width: 280px;
  height: calc(100vh - 60px);
  background: var(--dark-card);
  border-right: 1px solid var(--border);
  transition: var(--transition);
  z-index: 999;
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  color: var(--turquoise);
  background: rgba(0, 212, 170, 0.1);
  border-left-color: var(--turquoise);
}

.nav-item .icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1rem;
}

.nav-label {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  margin-top: 60px;
  padding: 1rem;
  min-height: calc(100vh - 60px);
}

/* Cards */
.card {
  background: var(--dark-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .sidebar {
    left: 0;
  }
  
  .main-content {
    margin-left: 280px;
  }
  
  .menu-toggle {
    display: none;
  }
}

.stat-card {
  background: var(--dark-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--turquoise);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* Forms */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: 1rem;
  background: var(--dark-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--turquoise);
}

.form-input::placeholder {
  color: var(--text-muted);
}

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

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

/* Form Grid Mobile */
.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Button Group */
.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 1;
  min-width: 80px;
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--dark-elevated);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--turquoise);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--turquoise);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Responsive improvements */
@media (max-width: 640px) {
  .card {
    padding: 1rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  
  .main-content {
    padding: 1rem 0.5rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
}

/* Week Grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.week-day {
  background: var(--dark-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.week-day:hover {
  border-color: var(--turquoise);
}

.week-day.active {
  background: rgba(0, 212, 170, 0.1);
  border-color: var(--turquoise);
}

.week-day-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.week-day-type {
  font-size: 0.875rem;
  font-weight: 600;
}

.week-day-duration {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--turquoise);
  color: var(--dark);
}

.btn-primary:hover {
  background: #00b894;
}

.btn-secondary {
  background: var(--dark-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-gold {
  background: var(--gold);
  color: var(--dark);
}

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

.stat-card.sleep-logged {
  border: 2px solid var(--turquoise);
  background: linear-gradient(135deg, var(--dark-elevated), rgba(0, 212, 170, 0.1));
}

/* Toggle Switch */
.toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--dark-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-switch.active {
  background: var(--turquoise);
  border-color: var(--turquoise);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-switch.active::after {
  left: calc(100% - 20px);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--dark-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--turquoise), var(--gold));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Overlay for mobile sidebar */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.status-badge.season {
  background: rgba(0, 212, 170, 0.2);
  color: var(--turquoise);
}

.status-badge.offseason {
  background: rgba(255, 215, 0, 0.2);
  color: var(--gold);
}

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
