@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #060d1a;
  --bg-secondary: #0a1628;
  --bg-card: #0f1f35;
  --bg-card-hover: #173a77;
  --surface: #1a2d45;
  --surface-2: #1f3552;

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.14);

  /* Accent — teal / ocean blue palette — NO purple, NO pink */
  --accent: #d73737;
  --accent-light: #9c3a3a;
  --accent-glow: rgba(8, 145, 178, 0.35);
  --accent-2: #2563eb;
  --accent-3: #10b981;

  /* Text */
  --text-primary: #e8f4f8;
  --text-secondary: #7ea8c4;
  --text-muted: #3d6480;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0369a1 0%, #0891b2 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(135deg, rgba(8, 145, 178, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
  --gradient-btn: linear-gradient(135deg, #0369a1, #0891b2);

  /* Shape */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadow */
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(8, 145, 178, 0.25);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

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

/* ── Typography ─────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--surface-2);
  transform: translateY(-2px);
}

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

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

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 10px;
  width: 40px;
  height: 40px;
  justify-content: center;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

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

.form-select {
  appearance: none;
  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='%237ea8c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select option {
  background: var(--surface);
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue {
  background: rgba(8, 145, 178, 0.18);
  color: var(--accent-light);
}

.badge-green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.badge-gray {
  background: rgba(60, 100, 130, 0.2);
  color: var(--text-secondary);
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  box-shadow: var(--shadow);
}

.toast-success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #34d399;
}

.toast-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #f87171;
}

.toast-info {
  background: rgba(8, 145, 178, 0.14);
  border: 1px solid rgba(8, 145, 178, 0.28);
  color: var(--accent-light);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(6, 13, 26, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.navbar-brand .logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-hero);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface);
}

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

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Error message (shared) ─────────────────────────────────────────────── */
.error-msg {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: #f87171;
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
}

/* ── Auth layout (login + register) ─────────────────────────────────────── */
.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}

.auth-container::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.1) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.45s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  text-decoration: none;
  color: var(--text-primary);
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-hero);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.auth-logo span {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 0.95rem;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Password / input icon ──────────────────────────────────────────────── */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--text-primary);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.input-icon-wrapper .form-input {
  padding-left: 42px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider,
.or-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before,
.divider::after,
.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Register perks ─────────────────────────────────────────────────────── */
.perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.perk {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.perk-icon {
  width: 24px;
  height: 24px;
  background: rgba(16, 185, 129, 0.14);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #34d399;
  flex-shrink: 0;
}

/* ── Connect page ───────────────────────────────────────────────────────── */
.connect-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.connect-body::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.1) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.connect-box {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 52px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.45s ease;
  position: relative;
}

.connect-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-hero);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px var(--accent-glow);
}

.connect-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.connect-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 40px;
  line-height: 1.6;
}

.code-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}

.digit-input {
  width: 58px;
  height: 72px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  caret-color: var(--accent-light);
}

.digit-input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
  background: var(--surface-2);
}

.digit-input.filled {
  border-color: rgba(8, 145, 178, 0.55);
  background: rgba(8, 145, 178, 0.08);
  color: var(--accent-light);
}

.digit-input.error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  animation: shake 0.4s ease;
}

.code-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.where-to-find {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  margin-top: 28px;
}

.where-to-find-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.where-to-find ol {
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.8;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  margin-top: 24px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ── Dashboard sidebar ──────────────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 36px;
  padding: 0 8px;
}

.sidebar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-hero);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.sidebar-item.active {
  color: var(--accent-light);
  background: rgba(8, 145, 178, 0.12);
}

.sidebar-icon {
  font-size: 1.1rem;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  margin-top: 12px;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dashboard main ─────────────────────────────────────────────────────── */
.main-content {
  overflow-y: auto;
}

.page-header {
  padding: 32px 40px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 28px 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px;
}

.stat-card:nth-child(1)::before {
  background: linear-gradient(90deg, #0369a1, #0891b2);
}

.stat-card:nth-child(2)::before {
  background: linear-gradient(90deg, #0891b2, #06b6d4);
}

.stat-card:nth-child(3)::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.boards-section {
  padding: 0 40px 40px;
}

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

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.board-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.board-card:hover {
  border-color: rgba(8, 145, 178, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(8, 145, 178, 0.1);
}

.board-preview {
  height: 160px;
  position: relative;
  overflow: hidden;
}

.board-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #0a1628, #0f2040);
}

.board-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
  opacity: 0;
  transition: var(--transition);
}

.board-card:hover .board-overlay {
  opacity: 1;
}

.board-actions-hover {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
}

.board-card:hover .board-actions-hover {
  opacity: 1;
  transform: translateY(0);
}

.board-info {
  padding: 16px 20px;
}

.board-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 145, 178, 0.14);
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
}

.code-pill:hover {
  background: rgba(8, 145, 178, 0.24);
}

.board-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.empty-state h3 {
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.create-card {
  background: var(--bg-card);
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 250px;
}

.create-card:hover {
  border-color: var(--accent);
  background: rgba(8, 145, 178, 0.05);
}

.create-card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-btn);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: var(--transition);
}

.create-card:hover .create-card-icon {
  transform: scale(1.1) rotate(5deg);
}

.create-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.create-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

.loading-boards {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
  grid-column: 1/-1;
}

/* ── Playlist scheduler ──────────────────────────────────────────────────── */
.scheduler-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

.playlist-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.playlist-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.playlist-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.playlist-item:hover {
  background: var(--surface);
}

.playlist-item.active {
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(8, 145, 178, 0.3);
}

.playlist-item-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.playlist-item-info {
  flex: 1;
  min-width: 0;
}

.playlist-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.playlist-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.playlist-topbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.clock-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-light);
}

.next-change-badge {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: #22d3ee;
  font-weight: 600;
  transition: var(--transition);
}

.active-board-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: #34d399;
  font-weight: 600;
}

.schedule-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.schedule-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
}

.schedule-empty .empty-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  opacity: 0.4;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.slot-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--slot-color, var(--accent));
  border-radius: 4px 0 0 4px;
}

.slot-card.is-active {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.slot-card.is-active::before {
  background: #10b981;
}

.slot-card.is-next {
  border-color: rgba(6, 182, 212, 0.28);
}

.slot-card.is-next::before {
  background: #06b6d4;
}

.slot-time {
  text-align: center;
  min-width: 100px;
}

.slot-time-range {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.slot-time-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.slot-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.slot-board {
  flex: 1;
  min-width: 0;
}

.slot-board-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-days {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.day-chip {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(8, 145, 178, 0.14);
  color: var(--accent-light);
  border: 1px solid rgba(8, 145, 178, 0.22);
}

.day-chip.off {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}

.slot-status {
  font-size: 0.73rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.slot-status.active {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
}

.slot-status.next {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
}

.slot-status.upcoming {
  background: var(--surface);
  color: var(--text-muted);
}

.slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.playlist-code-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  margin-left: auto;
}

.playlist-code-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.playlist-code-num {
  font-size: 1.4rem;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  letter-spacing: 5px;
  color: var(--accent-light);
}

.day-toggle-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.day-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 34px;
  padding: 0;
}

.day-toggle.on {
  background: rgba(8, 145, 178, 0.18);
  border-color: var(--accent);
  color: var(--accent-light);
}

.no-playlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  gap: 12px;
}

.no-playlist .icon {
  font-size: 4rem;
  opacity: 0.3;
}

/* ── Homepage ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.07) 0%, transparent 70%);
  top: 30%;
  right: 10%;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 145, 178, 0.14);
  border: 1px solid rgba(8, 145, 178, 0.28);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 28px;
  animation: fadeInDown 0.6s ease;
}

.hero h1 {
  animation: fadeInUp 0.7s ease 0.1s both;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.7s ease 0.3s both;
  margin-bottom: 80px;
}

.hero-preview {
  position: relative;
  width: 100%;
  max-width: 900px;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.preview-window {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 80px rgba(8, 145, 178, 0.12);
}

.preview-bar {
  background: var(--surface);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-content {
  background: linear-gradient(135deg, #060d1a 0%, #0a1628 50%, #0f2844 100%);
  height: 440px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-board-text {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.preview-board-sub {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
  text-align: center;
}

.preview-price {
  position: absolute;
  background: rgba(8, 145, 178, 0.88);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1.5rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.floating-layer {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  padding: 8px 14px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  animation: floatAnim 3s ease-in-out infinite;
}

.section {
  padding: 100px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 60px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-hero);
  opacity: 0;
  transition: var(--transition);
}

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

.feature-card:hover {
  border-color: rgba(8, 145, 178, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(8, 145, 178, 0.08);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-top: 60px;
}

.step {
  text-align: center;
  padding: 32px 20px;
}

.step-num {
  width: 60px;
  height: 60px;
  background: var(--gradient-btn);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px var(--accent-glow);
}

.step h3 {
  margin-bottom: 10px;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.cta-section {
  text-align: center;
  padding: 100px 24px;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(8, 145, 178, 0.12) 0%, transparent 70%);
}

footer {
  border-top: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Shared animations ───────────────────────────────────────────────────── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatAnim {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow {
  box-shadow: var(--shadow-glow);
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.text-sm {
  font-size: 0.875rem;
}

.text-muted {
  color: var(--text-secondary);
}

.w-full {
  width: 100%;
}

/* ── Mobile Layout & Responsive Design ──────────────────────────────────── */

@media (max-width: 1024px) {
  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 20px;
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding-bottom: 10px;
    padding-top: 10px;
  }
  
  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .hero {
    padding: 40px 20px;
    text-align: center;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-preview {
    margin-top: 40px;
    padding: 0;
    transform: scale(0.9);
  }
  
  .floating-layer {
    display: none; /* Hide floating elements on mobile to keep it clean */
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 20px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 20px;
  }
  
  .step::after {
    display: none;
  }

  .auth-box, .connect-box {
    padding: 30px 20px;
    width: 90%;
  }

  .dashboard-grid, .billing-grid, .team-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .board-card {
    margin-bottom: 20px;
  }
  
  #toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
    align-items: center;
  }
  
  .toast {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }
  .modal {
    padding: 20px;
    width: 95%;
  }
}


/* ── Sidebar Layout Mobile Fixes ────────────────────────────────────────── */

@media (max-width: 768px) {
  .page-layout {
    display: flex;
    flex-direction: column;
  }
  
  .sidebar {
    height: auto;
    width: 100%;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  /* Make nav links inside the sidebar flow horizontally on mobile */
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }
  
  .sidebar-nav-item {
    white-space: nowrap;
    margin-bottom: 0;
  }

  .sidebar-brand {
    margin-bottom: 16px;
    justify-content: center;
  }

  .scheduler-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
  }

  .playlist-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 250px; /* so we can scroll the list but see the content */
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
