/* ======================================================
   Chess Clock Legal Portal - Simple & Human Design System
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Light Theme (Default - Clean, Readable, Human) */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --brand-blue: #1e40af;
  --brand-blue-light: #eff6ff;
  --brand-blue-hover: #1d4ed8;
  --brand-accent: #d97706; /* Brass accent from analog dial */

  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --max-width: 960px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-surface: #1e293b;
  --bg-subtle: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --brand-blue: #3b82f6;
  --brand-blue-light: rgba(59, 130, 246, 0.12);
  --brand-blue-hover: #60a5fa;
  --brand-accent: #f59e0b;

  --border-color: #334155;
  --border-hover: #475569;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-app-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Simple Navigation Tabs */
.nav-tabs {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--brand-blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* Page Hero */
.doc-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 24px 24px;
  width: 100%;
}

.doc-hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-blue);
  background: var(--brand-blue-light);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.doc-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.doc-hero-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Main Layout */
.main-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px 24px;
  width: 100%;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Document Article Card */
.doc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.doc-section {
  margin-bottom: 36px;
}

.doc-section:last-child {
  margin-bottom: 0;
}

.doc-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.65;
}

.doc-section ul {
  margin: 12px 0 16px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.doc-section li {
  margin-bottom: 6px;
}

.doc-section code {
  background: var(--bg-subtle);
  color: var(--text-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-family: monospace;
}

/* Simple Note Card */
.note-box {
  background: var(--brand-blue-light);
  border-left: 4px solid var(--brand-blue);
  padding: 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

.note-box p {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin: 0;
  font-weight: 500;
}

/* Contact Card */
.contact-section {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

.contact-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-blue);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 24px;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

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

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

/* Responsive */
@media (max-width: 640px) {
  .header-container {
    padding: 12px 16px;
  }
  
  .doc-hero {
    padding: 24px 16px 16px 16px;
  }

  .doc-hero-title {
    font-size: 1.75rem;
  }

  .main-container {
    padding: 0 16px 40px 16px;
  }

  .doc-card {
    padding: 24px 20px;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
}
