/* Coach SaaS Platform - Main Styles */
/* Design: Minimal, clean, dark mode by default */

:root {
  /* Colors - Modern Light Mode (Fonio.ai inspired) */
  --bg-primary: #ffffff;
  --bg-secondary: #fafbfc;
  --bg-tertiary: #f3f4f6;
  --bg-accent: #f8f7ff;
  --accent: #6c47ff;
  --accent-hover: #5a38eb;
  --accent-light: rgba(108, 71, 255, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

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

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.5rem; /* 8px = 0.5rem for rounded-lg */
  --radius-xl: 1rem;

  /* Transitions */
  --transition: 150ms ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 60px; /* Account for fixed header bar */
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* Layout - removed unused flex utilities */

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

/* Primary buttons - Vibrant purple gradient */
.btn-primary {
  background: linear-gradient(135deg, #6c47ff 0%, #5a38eb 100%);
  color: white;
  box-shadow: 0 1px 3px rgba(108, 71, 255, 0.12), 0 8px 24px rgba(108, 71, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a38eb 0%, #4b2dd6 100%);
  box-shadow: 0 2px 4px rgba(108, 71, 255, 0.15), 0 12px 32px rgba(108, 71, 255, 0.25);
  transform: translateY(-1px);
}

/* Secondary buttons - Light background with border */
.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: #d1d5db;
}

/* Tertiary buttons - WHITE background (for light mode) */
.btn-tertiary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

/* Ghost buttons - no background */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
}

/* Input fields - outlined style with purple focus ring */
.input-group {
  margin-bottom: var(--space-lg);
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.input-field {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: transparent; /* Transparent background */
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition);
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(106, 73, 242, 0.1); /* Purple focus ring */
}

.input-field::placeholder {
  color: var(--text-tertiary);
}

.input-error {
  border-color: var(--error);
}

.input-error:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: var(--space-xs);
}

/* Removed unused input-wrapper and input-icon styles */

/* Top Header Bar - Always visible */
.top-header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hamburger-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.header-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 150ms ease;
}

.header-brand:hover {
  color: var(--accent);
}

.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--error);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* Search Overlay - Centered with smooth animation */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 250ms ease;
}

.search-overlay.active {
  display: flex;
  opacity: 1;
}

.search-overlay-content {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  width: 90%;
  max-width: 600px;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95) translateY(-20px);
  opacity: 0;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active .search-overlay-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.search-overlay-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 1.125rem;
  color: var(--text-primary);
  outline: none;
}

.search-overlay-input::placeholder {
  color: var(--text-tertiary);
}

.search-overlay-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-overlay-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Sidebar Menu - Toggleable Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  z-index: 1600;
  transform: translateX(-100%);
  transition: transform 300ms ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem;
}

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

.sidebar-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
}

.sidebar-menu-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 8px;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
}

.sidebar-profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.sidebar-role-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.sidebar-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--accent-light);
}

.sidebar-avatar-placeholder {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  border: 2px solid var(--border);
}

.sidebar-username {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.sidebar-useremail {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9375rem;
  font-weight: 500;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(108, 71, 255, 0.12) 0%, rgba(108, 71, 255, 0.08) 100%);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-link-logout {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--error);
}

.sidebar-link-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--error);
}

.main-content {
  flex: 1;
  margin-left: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

/* Desktop: Show sidebar, hide burger menu */
@media (min-width: 769px) {
  .desktop-sidebar-wrapper .main-content {
    margin-left: 0;
  }

  /* Hide burger menu on desktop */
  .mobile-header {
    display: none !important;
  }

  .burger-menu,
  .burger-menu-overlay {
    display: none !important;
  }
}

/* Mobile: Hide sidebar, show burger menu */
@media (max-width: 768px) {
  .desktop-sidebar-wrapper .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 5rem;
  }
}

/* Avatars - rounded square (keeping base class only) */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: var(--bg-tertiary);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 5rem;
  right: var(--space-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
}

.toast {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-md);
  min-width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  animation: toastSlideIn 150ms ease forwards;
}

.toast.success {
  border-left: 3px solid #6c47ff;
}

.toast.error {
  border-left: 3px solid var(--error);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Removed unused responsive sidebar styles */

/* Utility classes - kept only what's used */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Spacing utilities matching guidelines */
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.p-6 {
  padding: 1.5rem;
}

/* Dark Mode - Modern & Clean */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-accent: #1a1625;
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
}

[data-theme="dark"] body {
  background: var(--bg-secondary);
}

[data-theme="dark"] .card {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .btn-secondary {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .input-field {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="dark"] .input-field:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
}

[data-theme="dark"] .toast {
  background: var(--bg-primary);
  border-color: rgba(255, 255, 255, 0.08);
}
