/* ============================
   GLOBAL STYLES - Plan4Eagles
   ============================ */

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

/* ============================
   DESIGN TOKENS
   ============================ */

:root {
  /* Brand */
  --maroon: #8e0c03;
  --maroon-dark: #6b0902;
  --gold: #b59a57;
  --gold-dark: #9a814a;

  /* Surfaces */
  --bg-page: #fafafa;
  --bg-warm: #f6f1e9;
  --bg-card: #ffffff;
  --bg-soft: #faf7f2;
  --bg-cream: #fffdf7;

  /* Text */
  --text-main: #3a3a3a;
  --text-soft: #5a4a3a;
  --text-muted: #7a6a55;
  --text-faint: #998a75;

  /* Borders */
  --border-light: #e6e6e6;
  --border-warm: #efe7d8;
  --border-warm-strong: #eee0c6;
  --border-input: #d8cab2;

  /* Status */
  --success: #2e7d4f;
  --success-bg: #e8f5ee;
  --warning: #9a6d1b;
  --warning-bg: #fdf3e0;
  --error: #b3261e;
  --error-bg: #fdecea;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Elevation */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Focus */
  --focus-ring: 2px solid var(--maroon);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: 'Quicksand', system-ui, sans-serif;
}

/* Consistent visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ============================
   NAVBAR
   ============================ */

.navbar {
  height: 60px;
  padding: 0 28px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Quicksand', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar nav {
  display: flex;
  gap: 4px;
}

.navbar nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.navbar nav a:hover {
  background-color: rgba(181, 154, 87, 0.7);
  color: white;
}

.navbar nav a.active {
  background-color: var(--gold);
  color: white;
}

.navbar nav a:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ============================
   BUTTONS
   ============================ */

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 10px 18px;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.btn-primary {
  background: var(--maroon);
}

.btn-primary:hover {
  background: var(--maroon-dark);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ============================
   SHARED TEXT HELPERS
   ============================ */

.hint-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.disclaimer-text {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}

/* ============================
   EMPTY-STATE BANNER (shared)
   ============================ */

.grid-status {
  margin: 0 0 12px;
  padding: 12px 16px;
  background: var(--bg-cream);
  border: 1px dashed var(--border-input);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================
   TOASTS
   ============================ */

#toast-region {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--text-main);
  color: white;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  animation: toastIn 0.25s ease;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

.toast-leaving {
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

/* ============================
   SCROLLBAR STYLING
   ============================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f0e8;
}

::-webkit-scrollbar-thumb {
  background: #d4c9b4;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============================
   TRANSITIONS
   ============================ */

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* ============================
   MOBILE NAVBAR
   ============================ */

@media (max-width: 640px) {
  .navbar {
    padding: 8px 12px;
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 10px;
  }

  .logo {
    font-size: 17px;
  }

  .navbar nav {
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar nav a {
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
}
