:root {
  --bg-primary: #f5ebe0;
  --bg-secondary: #ede0d4;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --accent: #b85c38;
  --accent-hover: #9a4a2e;
  --border: #d6ccc2;
  --shadow: rgba(0, 0, 0, 0.1);
  --error: #c73e1d;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2a2a2a;
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --accent: #4a8a6f;
  --accent-hover: #5a9a7f;
  --border: #404040;
  --shadow: rgba(0, 0, 0, 0.3);
}

/* Import Inter font (similar to Aeonik) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hidden {
  display: none !important;
}

.version-info {
  position: fixed;
  bottom: 8px;
  right: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.5;
  font-weight: 500;
  pointer-events: none;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 800px;
}

.logo {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  display: block;
}

.wordmark {
  max-width: 300px;
  height: auto;
  margin: 0 auto 2rem;
  display: block;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow);
}

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

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

/* Login Screen */
#loginScreen .container {
  text-align: center;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-content {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  gap: 0.5rem;
}

.theme-btn {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

/* Notes */
#notesField {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 1rem;
}

#notesField:focus {
  outline: none;
  border-color: var(--accent);
}

/* Login History */
.login-history {
  max-height: 200px;
  overflow-y: auto;
}

.login-entry {
  padding: 0.75rem;
  background: var(--bg-primary);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

/* User Info */
.user-info p {
  margin-bottom: 0.5rem;
}

.user-info strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Loading */
.loader {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

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

#loadingScreen .container {
  text-align: center;
}

/* Error Toast */
.error-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  animation: slideDown 0.3s ease;
}

.error-toast:empty {
  display: none;
}

/* Success Toast */
.success-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 1000;
  font-size: 0.9rem;
  animation: slideUp 0.3s ease;
}

.success-toast:empty {
  display: none;
}

@keyframes slideDown {
  from {
    transform: translate(-50%, -100px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

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

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 1rem;
  z-index: 100;
  box-shadow: 0 -2px 10px var(--shadow);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  outline: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 500;
  flex: 1;
  position: relative;
}

.nav-item:focus {
  outline: none;
}

.nav-item:hover {
  color: var(--accent);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.nav-logo-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  position: relative;
  top: -10px;
  background: var(--bg-primary);
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Page Header (replaces dashboard-header) */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Classes List */
.classes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 90px; /* Space for bottom nav */
}

.class-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow);
}

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

.class-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.class-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.class-badge.attended {
  background: #d4edda;
  color: #155724;
}

[data-theme="dark"] .class-badge.attended {
  background: #1e4620;
  color: #a3d9a5;
}

.class-badge.booked {
  background: #fff3cd;
  color: #856404;
}

[data-theme="dark"] .class-badge.booked {
  background: #4a3f1a;
  color: #ffeaa7;
}

.class-badge.cancelled {
  background: #f8d7da;
  color: #721c24;
}

[data-theme="dark"] .class-badge.cancelled {
  background: #3d1a1c;
  color: #f5c2c7;
}

.class-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.class-detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.class-detail-row svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Membership Card */
.membership-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

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

.membership-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.membership-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #d4edda;
  color: #155724;
}

[data-theme="dark"] .membership-badge {
  background: #1e4620;
  color: #a3d9a5;
}

.membership-badge.frozen {
  background: #cce5ff;
  color: #004085;
}

[data-theme="dark"] .membership-badge.frozen {
  background: #1a3a52;
  color: #b3d9ff;
}

.membership-dates {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

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

.usage-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Profile Content */
.profile-content {
  padding-bottom: 90px; /* Space for bottom nav */
}

.profile-content .card {
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .class-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
