/* ------------------------------
   Base styles
------------------------------ */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  padding: 0;
}

:root {
  /* Landing page / light mode colors */
  --main-bg: #181c4b;        /* dark blue main background */
  --main-color: #8fde2b;     /* bright green for main words/buttons */
  --sub-color: #15d3c3;      /* cyan for sub text */
  --subsub-color: #abb1bf;   /* light gray for tertiary text */
  --alt-color: #ffffff;       /* white for text on dark backgrounds */
}

/* Dark mode overrides */
body.dark {
  --main-bg: #0f122d;
  --main-color: #8fde2b;
  --sub-color: #15d3c3;
  --subsub-color: #abb1bf;
  --alt-color: #ffffff;
}

body {
  min-height: 100vh;
  background: linear-gradient(rgba(24,28,75,0.7), rgba(24,28,75,0.7)), url('../assets/images/bg.jpg') no-repeat center center / cover;
  color: var(--alt-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ------------------------------
   Container & Cards
------------------------------ */
.container, .auth-card, .card {
  background: rgba(24, 28, 75, 0.85);
  backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: fadeIn 0.8s ease;
  color: var(--alt-color);
  transition: background 0.3s ease, color 0.3s ease;
}

.card {
  height: 120px;
  margin-bottom: 1rem;
}

/* ------------------------------
   Headings & Text
------------------------------ */
h1, h2 {
  color: var(--main-color);
  margin-bottom: 0.5rem;
}

p.tagline {
  color: var(--sub-color);
  opacity: 0.9;
  margin-bottom: 2rem;
}

p.subsub {
  color: var(--subsub-color);
}

/* ------------------------------
   Buttons
------------------------------ */
.buttons, .btn-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* All buttons in .buttons/.btn-group full width except #themeToggle */
.buttons .btn,
.btn-group .btn,
button.install-btn {
  width: 100%;
}

.btn {
  padding: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.btn.primary {
  background: var(--main-color);
  color: var(--main-bg);
}

.btn.secondary {
  background: var(--alt-color);
  color: var(--main-bg);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Theme toggle button */
#themeToggle {
  width: auto; /* natural width */
  padding: 0.6rem 1rem;
}

/* ------------------------------
   Splash Screen
------------------------------ */
#splash {
  position: fixed;
  inset: 0;
  background: var(--main-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--main-color);
  z-index: 9999;
  animation: splashFade 1s ease forwards;
}

#splash .logo {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 1.2s infinite;
}

/* ------------------------------
   PWA Install Button
------------------------------ */
.install-btn {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.9rem; /* match other buttons */
  border-radius: 999px;
  border: none;
  background: var(--main-color);
  color: var(--main-bg);
  font-weight: 600;
  display: none;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ------------------------------
   Bottom Navigation
------------------------------ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(24,28,75,0.95);
  display: flex;
  justify-content: space-around;
  padding: 0.6rem 0;
  box-shadow: 0 -10px 20px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
}

.bottom-nav a {
  text-decoration: none;
  color: var(--alt-color);
  font-size: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-nav span {
  font-size: 0.7rem;
}

.bottom-nav a.active {
  color: var(--main-color);
}

/* ------------------------------
   Skeleton Loading
------------------------------ */
.skeleton {
  background: linear-gradient(90deg, #2a2f65 25%, #3d4378 37%, #2a2f65 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 12px;
}

.line {
  height: 16px;
  width: 80%;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* ------------------------------
   Animations
------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splashFade {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ------------------------------
   Forms (Login / Register)
------------------------------ */
input, textarea {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid var(--subsub-color);
  background: rgba(24,28,75,0.7);
  color: var(--alt-color);
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

input::placeholder, textarea::placeholder {
  color: var(--subsub-color);
}

button[type="submit"] {
  background: var(--main-color);
  color: var(--main-bg);
  border: none;
  padding: 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s ease, color 0.3s ease;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* ------------------------------
   Dark mode specific adjustments
------------------------------ */
body.dark .container, 
body.dark .auth-card, 
body.dark .card {
  background: rgba(24, 28, 75, 0.85);
}

body.dark input, 
body.dark textarea {
  background: rgba(24,28,75,0.7);
  color: var(--alt-color);
  border-color: var(--subsub-color);
}

body.dark .bottom-nav {
  background: rgba(24,28,75,0.95);
}

body.dark .skeleton {
  background: linear-gradient(90deg, #2a2f65 25%, #3d4378 37%, #2a2f65 63%);
}
