/* ==================== NOTHING: RANKED - BASE STYLES ==================== */
/* Global unified styles for all pages */

/* ==================== CSS VARIABLES ==================== */
:root {
  --bg: #0a0a0a;
  --fg: #eaeaea;
  --accent: #9ae6b4;
  --muted: #bdbdbd;
  --border: #222;
  --hover: rgba(154, 230, 180, 0.1);
  --card-bg: #111;
  --transition: 200ms ease;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #666;
  --border: #e0e0e0;
  --hover: rgba(154, 230, 180, 0.15);
  --card-bg: #f9f9f9;
}

/* System theme - default to dark, but respect prefers-color-scheme */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #666;
    --border: #e0e0e0;
    --hover: rgba(154, 230, 180, 0.15);
    --card-bg: #f9f9f9;
  }
}

/* ==================== RESET & BASE ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--accent);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

strong {
  font-weight: 700;
  color: var(--fg);
}

/* ==================== BRAND TITLE ==================== */
.brand-title {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: opacity var(--transition);
}

.brand-title:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* ==================== LAYOUT ==================== */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

/* ==================== HEADER ==================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  text-decoration: none;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-status {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ==================== HAMBURGER MENU ==================== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--fg);
  transition: all 0.3s ease;
  border-radius: 2px;
}

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

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

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

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 99;
  padding-top: 4rem;
  overflow-y: auto;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav-links {
  list-style: none;
  padding: 2rem 1.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 1rem 0;
  color: var(--fg);
  font-size: 1.25rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--accent);
  text-decoration: none;
}

/* ==================== FOOTER ==================== */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-link {
  color: var(--muted);
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--accent);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card-content {
  color: var(--muted);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  border-color: var(--muted);
  color: var(--muted);
}

.btn-secondary:hover {
  background: var(--muted);
  color: var(--bg);
}

/* ==================== FORMS ==================== */
input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9rem;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }

/* ==================== GRID SYSTEM ==================== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }

  .container {
    padding: 0 1rem;
  }

  header {
    padding: 0.75rem 1rem;
  }

  .header-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==================== LOADING STATES ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--card-bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
