/* main.css - Shared styles, variables, reset, typography, layout, nav, footer */

/* ============================================================================
   CSS Reset & Variables
   ============================================================================ */

:root {
  /* Accent (unified buttons) */
  --accent: #0a84ff;
  --accent-hover: #0077ee;
  --accent-active: #0066cc;
  --accent-focus-ring: 0 0 0 3px rgba(10, 132, 255, 0.35);
  --radius-btn: 12px;
  --radius-btn-sm: 10px;
  --btn-disabled-opacity: 0.55;

  /* Brand Colors */
  --color-primary: #0a84ff;
  --color-primary-dark: #0077ee;
  --color-primary-light: rgba(10, 132, 255, 0.12);

  /* Neutrals */
  --color-white: #ffffff;
  --color-off-white: #f8f9fa;
  --color-light-gray: #e8eaed;
  --color-mid-gray: #9aa0a6;
  --color-dark-gray: #5f6368;
  --color-charcoal: #202124;
  --color-near-black: #171717;

  /* Semantic */
  --color-success: #34a853;
  --color-warning: #fbbc04;
  --color-error: #ea4335;

  /* Dark theme (dashboard) */
  --bg-dark: #121212;
  --bg-card: #1e1e1e;
  --bg-sidebar: #181818;
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1a6;
  --accent-blue: #4285f4;
  --border-color: #2b2b2b;

  /* Layout */
  --nav-height: 64px;
  --max-width: 1200px;
  --section-padding: 96px 0;
  --section-padding-mobile: 64px 0;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

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

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

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-charcoal);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-charcoal);
}

h1 { font-size: 3rem; letter-spacing: -0.03em; }
h2 { font-size: 2rem; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* ============================================================================
   Layout Utilities
   ============================================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

/* ============================================================================
   Navigation
   ============================================================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-light-gray);
  z-index: 1000;
  transition: box-shadow var(--transition-normal);
}

.site-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-charcoal);
  letter-spacing: -0.5px;
}

.nav-brand span {
  color: var(--color-mid-gray);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark-gray);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--color-charcoal);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--color-charcoal);
  color: var(--color-white) !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.nav-cta:hover {
  background: #333;
  color: var(--color-white) !important;
  transform: translateY(-1px);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-charcoal);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-light-gray);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-links a {
    font-size: 16px;
    padding: 8px 0;
  }
}

/* ============================================================================
   Buttons
   ============================================================================ */

/* Button design system: Primary (one per surface), Secondary (outlined), Ghost (icon/low emphasis) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--accent-focus-ring);
}
.btn:disabled {
  opacity: var(--btn-disabled-opacity);
  cursor: not-allowed;
}

/* Primary: Install Extension, + Save (popup) */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-primary:active {
  background: var(--accent-active);
}

/* Secondary: Login to Dashboard, Sync Data, Check Prices, Hide Chart, Manage Tags */
.btn-secondary {
  background: transparent;
  color: var(--color-charcoal);
  border: 1px solid rgba(0, 0, 0, 0.16);
}
.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--color-charcoal);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: var(--radius-btn-sm);
}

/* ============================================================================
   Footer
   ============================================================================ */

.site-footer {
  background: var(--color-near-black);
  color: var(--color-mid-gray);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-white);
}

.footer-brand span {
  color: var(--color-mid-gray);
  font-weight: 400;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--color-mid-gray);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: #555;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #2a2a2a;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.text-center { text-align: center; }
.text-secondary { color: var(--color-dark-gray); }
.text-small { font-size: 14px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
