/* ==========================================
   DotNotBoard — Visual Polish
   Preserves: /images/background.png (sacred)
   Enhances: spacing, typography, hierarchy, transitions
   ========================================== */

/* --- Root & Variables --- */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --accent: #48dbfb;
  --accent-hover: #2ab7e8;
  --card-bg: rgba(26, 33, 66, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #e0e4e8;
  --text-muted: #a8b0be;
  --success: #26de81;
  --warning: #f5a623;
  --error: #ff5b5b;
}

/* --- Body & Background (Preserves Sacred Background Image) --- */
body {
  font-family: 'Segoe UI', Tahoma, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  /* Sacred: Background image from /images/background.png */
  background: url('/images/background.png') no-repeat center center fixed;
  background-size: cover;
  background-color: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* --- Header --- */
header {
  background: rgba(26, 33, 66, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}
header .logo {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
}
header nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
header nav a {
  color: var(--text-muted);
  margin-left: 0.5rem;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 0.85rem;
  white-space: nowrap;
}
header nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}
header nav a.active {
  background: rgba(72, 219, 251, 0.15);
  color: var(--accent);
}
header nav form {
  display: inline;
  margin: 0;
}
header nav form button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  font: inherit;
  border-radius: 6px;
  transition: background 0.2s;
  white-space: nowrap;
}
header nav form button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}
header nav form button.btn-logout {
  background: rgba(255, 91, 91, 0.15);
  color: var(--error);
  border: 1px solid rgba(255, 91, 91, 0.3);
  border-radius: 6px;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  margin-left: 0.5rem;
}
header nav form button.btn-logout:hover {
  background: rgba(255, 91, 91, 0.25);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 120px 2rem 3rem;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.hero p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(72, 219, 251, 0.25);
}
.btn-secondary {
  background: #0066ff;
  color: #fff;
}
.btn-secondary:hover {
  background: #0052cc;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* --- Forms --- */
form {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
}
form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}
form input,
form select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  margin-top: 0.2rem;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus,
form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(72, 219, 251, 0.15);
}
form input::placeholder {
  color: var(--text-muted);
}

/* --- Auth Cards (Login / Register) --- */
.auth-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
  padding: 2rem 1rem;
}
.auth-card {
  max-width: 420px;
  width: 100%;
  background: rgba(26, 33, 66, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}
.auth-card h2 {
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  font-size: 1.6rem;
}
.auth-card p {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* --- Dashboard --- */
.dashboard {
  max-width: 1100px;
  margin: 70px auto 0;
  padding: 0 1rem;
}
.dashboard-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}
.dashboard-header h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.6rem;
  color: var(--text-primary);
}
.dashboard-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.dashboard-card {
  background: rgba(26, 33, 66, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.dashboard-card h3 {
  margin: 0 0 0.75rem 0;
  color: var(--accent);
  font-size: 1.05rem;
}

/* --- Progress / Items --- */
.progress-item {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--card-border);
}
.progress-item:last-of-type {
  border-bottom: none;
}
.progress-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.progress-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Profile Page --- */
.profile-page {
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 80px auto 0;
  padding: 0 1rem;
}
.profile-card {
  background: rgba(26, 33, 66, 0.45);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  backdrop-filter: blur(12px);
}
.profile-card h2 {
  margin: 0 0 1rem 0;
  color: var(--accent);
}
.profile-card p {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* --- Cookie Consent --- */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-size: 0.85rem;
  display: none;
  align-items: center;
  justify-content: space-between;
}
.cookie-consent-banner.visible {
  display: flex;
  animation: slideUp 0.3s ease-out forwards;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cookie-consent-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}
.cookie-consent-text a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}
.cookie-consent-text a:hover {
  color: var(--accent-hover);
}
.cookie-consent-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cookie-btn {
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.1s ease;
}
.cookie-btn-accept {
  background: var(--success);
  color: #fff;
}
.cookie-btn-accept:hover {
  background: #2d9e65;
}
.cookie-btn-reject {
  background: var(--warning);
  color: #111;
}
.cookie-btn-reject:hover {
  background: #e5a01d;
}
.cookie-btn-settings {
  background: var(--text-muted);
  color: #fff;
}
.cookie-btn-settings:hover {
  background: #667f91;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  header {
    padding: 0.6rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  header .logo {
    font-size: 1rem;
  }
  header nav a {
    margin: 0.15rem 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
  }
  .hero {
    padding: 80px 1rem 1.5rem;
  }
  .hero h2 {
    font-size: 1.5rem;
  }
  form {
    padding: 1rem;
  }
  .dashboard {
    margin-top: 120px;
  }
  .dashboard-card {
    padding: 1rem;
  }
}

/* --- Form Actions (Login/Register buttons) --- */
.form-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
}
.form-actions .btn {
  display: inline-block;
  width: auto;
  min-width: 140px;
}

/* --- Ensure consistent auth page background --- */
.auth-center {
  background: transparent;
  min-height: calc(100vh - 60px);
  padding-top: 0;
}
/* --- Dashboard Profile Tab Centering (matches auth pages) --- */
#profile-tab .dashboard-header {
  text-align: center;
}
#profile-tab .auth-card {
  width: auto;
  margin: 0 auto;
}
