/**
 * Vote-Yo Design System & Base Layout (main.css)
 */

:root {
  --font-display: 'Impact', 'Arial Black', -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Brand Colors */
  --color-cream: #FFF8E7;
  --color-cream-subtle: #FFFDF7;
  --color-navy: #0F172A;
  --color-navy-light: #1E293B;
  --color-navy-muted: #334155;
  --color-red: #E11D48;
  --color-red-hover: #BE123C;
  --color-yellow: #FACC15;
  --color-yellow-light: #FEF08A;
  --color-blue: #2563EB;
  --color-blue-light: #60A5FA;
  --color-gray-50: #F8FAFC;
  --color-gray-100: #F1F5F9;
  --color-gray-200: #E2E8F0;
  --color-gray-300: #CBD5E1;
  --color-gray-400: #94A3B8;
  --color-gray-500: #64748B;
  --color-white: #FFFFFF;

  /* UI Tokens */
  --bg-app: var(--color-cream);
  --text-main: var(--color-navy);
  --text-muted: var(--color-gray-500);
  --border-color: var(--color-navy);
  --border-width: 3px;
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  --shadow-chunky: 4px 4px 0px var(--color-navy);
  --shadow-chunky-hover: 6px 6px 0px var(--color-navy);
  --shadow-soft: 0 10px 25px -5px rgba(15, 23, 42, 0.08);

  --max-width: 1240px;
  --header-height: 72px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Accessibility: Visible Focus Rings */
:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 3px;
}

/* Nonpartisan Top Banner */
.nonpartisan-top-banner {
  background-color: var(--color-navy);
  color: var(--color-yellow-light);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 1rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.nonpartisan-top-banner strong {
  color: var(--color-white);
}

/* App Header */
.app-header {
  height: var(--header-height);
  background: var(--color-cream-subtle);
  border-bottom: var(--border-width) solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-navy);
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(2px 2px 0px rgba(15, 23, 42, 0.2));
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.8125rem;
  color: var(--color-red);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Navigation Tabs */
.app-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-tab-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  background-color: rgba(15, 23, 42, 0.06);
}

.nav-tab-btn.is-active {
  background-color: var(--color-navy);
  color: var(--color-white);
  box-shadow: 2px 2px 0px var(--color-red);
}

.nav-action-btn {
  background-color: var(--color-yellow);
  border: 2px solid var(--color-navy);
  border-radius: var(--border-radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--color-navy);
  transition: transform 0.1s ease;
}

.nav-action-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--color-navy);
}

/* Offline Pill */
.offline-pill {
  display: none;
  background-color: #EA580C;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.offline-pill.is-visible {
  display: inline-block;
  animation: pulseOffline 2s infinite;
}

@keyframes pulseOffline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Main Container */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Tab Panels */
.app-tab-panel {
  display: none;
}

.app-tab-panel.is-active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* Daily Drop Ribbon Banner */
.daily-drop-banner {
  background: linear-gradient(135deg, var(--color-yellow) 0%, #F59E0B 100%);
  border: var(--border-width) solid var(--color-navy);
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-chunky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.daily-drop-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.daily-drop-badge {
  background-color: var(--color-red);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 2px solid var(--color-navy);
}

.daily-drop-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-navy);
}

/* Generic Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9375rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--border-radius-sm);
  border: var(--border-width) solid var(--border-color);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  line-height: 1.2;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--border-color);
}

.btn-primary {
  background-color: var(--color-red);
  color: var(--color-white);
  box-shadow: var(--shadow-chunky);
}

.btn-primary:hover {
  background-color: var(--color-red-hover);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-chunky-hover);
}

.btn-secondary {
  background-color: var(--color-yellow);
  color: var(--color-navy);
  box-shadow: var(--shadow-chunky);
}

.btn-secondary:hover {
  background-color: #FDE047;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-chunky-hover);
}

.btn-outline {
  background-color: var(--color-white);
  color: var(--color-navy);
  box-shadow: var(--shadow-chunky);
}

.btn-outline:hover {
  background-color: var(--color-gray-100);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-chunky-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-navy);
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: rgba(15, 23, 42, 0.08);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  font-size: 1.1em;
}

/* App Footer */
.app-footer {
  background-color: var(--color-cream-subtle);
  border-top: var(--border-width) solid var(--border-color);
  padding: 3rem 1.25rem 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  max-width: 400px;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-desc {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-bottom: 1rem;
}

.footer-notice {
  font-size: 0.8125rem;
  background-color: #FEF3C7;
  border: 2px solid #F59E0B;
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  color: #78350F;
  font-weight: 600;
}

.footer-links-group {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-col-title {
  font-weight: 800;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-list a, .footer-nav-list button {
  font-size: 0.875rem;
  color: var(--color-navy);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.footer-nav-list a:hover, .footer-nav-list button:hover {
  color: var(--color-red);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--color-gray-200);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--color-gray-500);
}

/* Toast */
.vote-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: 0.85rem 1.4rem;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--color-yellow);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-weight: 700;
  font-size: 0.9375rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
  pointer-events: none;
}

.vote-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .app-header {
    height: auto;
    padding: 0.75rem 0;
  }
  .header-container {
    flex-direction: column;
    gap: 0.75rem;
  }
  .app-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .daily-drop-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .vote-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }
}
