/* ==========================================================================
   TheCyberPicks Design System
   Tokens from vpn-site-instructions.md Section 9
   ========================================================================== */

/* --- 9.1 Color tokens --- */
:root {
  --tcp-primary: #0B5FFF;
  --tcp-primary-dark: #083FB8;
  --tcp-accent: #00C896;
  --tcp-warning: #FF9F1C;
  --tcp-danger: #E63946;

  --tcp-bg: #FFFFFF;
  --tcp-bg-alt: #F7F9FC;
  --tcp-text: #1A2332;
  --tcp-text-muted: #5A6878;
  --tcp-border: #E1E7EF;

  --tcp-rating-star: #FFB400;
}

/* --- 9.2 Typography --- */
:root {
  --tcp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tcp-font-heading: 'Inter', sans-serif;

  --tcp-fs-base: 1.0625rem;
  --tcp-fs-h1: 2.25rem;
  --tcp-fs-h2: 1.75rem;
  --tcp-fs-h3: 1.375rem;
  --tcp-fs-small: 0.875rem;

  --tcp-lh-body: 1.65;
  --tcp-lh-heading: 1.25;
}

/* --- 9.3 Spacing scale --- */
:root {
  --tcp-space-1: 0.25rem;
  --tcp-space-2: 0.5rem;
  --tcp-space-3: 0.75rem;
  --tcp-space-4: 1rem;
  --tcp-space-6: 1.5rem;
  --tcp-space-8: 2rem;
  --tcp-space-12: 3rem;
  --tcp-space-16: 4rem;
}

/* --- Base typography --- */
body {
  font-family: var(--tcp-font-body);
  font-size: var(--tcp-fs-base);
  line-height: var(--tcp-lh-body);
  color: var(--tcp-text);
  background: var(--tcp-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tcp-font-heading);
  line-height: var(--tcp-lh-heading);
  color: var(--tcp-text);
}

h1 { font-size: var(--tcp-fs-h1); }
h2 { font-size: var(--tcp-fs-h2); }
h3 { font-size: var(--tcp-fs-h3); }

/* --- 9.5 CTA button styles --- */
.tcp-cta-button {
  display: inline-block;
  padding: var(--tcp-space-3) var(--tcp-space-6);
  background: var(--tcp-primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: var(--tcp-fs-base);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  border: none;
  cursor: pointer;
}

.tcp-cta-button:hover,
.tcp-cta-button:focus {
  background: var(--tcp-primary-dark);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.tcp-cta-button:focus-visible {
  outline: 3px solid var(--tcp-accent);
  outline-offset: 2px;
}

.tcp-cta-button.tcp-cta-secondary {
  background: transparent;
  color: var(--tcp-primary);
  border: 2px solid var(--tcp-primary);
}

.tcp-cta-button.tcp-cta-secondary:hover,
.tcp-cta-button.tcp-cta-secondary:focus {
  background: var(--tcp-primary);
  color: #FFFFFF;
}

/* --- Affiliate disclosure component --- */
.tcp-disclosure {
  background: var(--tcp-bg-alt);
  border-left: 4px solid var(--tcp-primary);
  padding: var(--tcp-space-3) var(--tcp-space-4);
  margin-bottom: var(--tcp-space-6);
  font-size: var(--tcp-fs-small);
  color: var(--tcp-text-muted);
  border-radius: 0 4px 4px 0;
}

.tcp-disclosure a {
  color: var(--tcp-primary);
  text-decoration: underline;
}

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

/* --- Skip-to-content --- */
.tcp-skip-link {
  position: absolute;
  top: -100%;
  left: var(--tcp-space-4);
  z-index: 10000;
  padding: var(--tcp-space-2) var(--tcp-space-4);
  background: var(--tcp-primary);
  color: #FFFFFF;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}

.tcp-skip-link:focus {
  top: 0;
}

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

.tcp-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--tcp-space-3) var(--tcp-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tcp-space-4);
}

.tcp-logo {
  font-family: var(--tcp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tcp-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--tcp-space-2);
  flex-shrink: 0;
}

.tcp-logo:hover {
  color: var(--tcp-primary);
}

.tcp-logo-accent {
  color: var(--tcp-primary);
}

/* --- Main navigation --- */
.tcp-nav {
  display: none;
}

.tcp-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--tcp-space-6);
}

.tcp-nav-list a {
  color: var(--tcp-text);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--tcp-fs-small);
  padding: var(--tcp-space-2) 0;
  transition: color 0.15s ease;
}

.tcp-nav-list a:hover,
.tcp-nav-list a:focus {
  color: var(--tcp-primary);
}

.tcp-nav-list a[aria-current="page"] {
  color: var(--tcp-primary);
  border-bottom: 2px solid var(--tcp-primary);
}

/* --- Header utilities (search + mobile toggle) --- */
.tcp-header-actions {
  display: flex;
  align-items: center;
  gap: var(--tcp-space-3);
}

.tcp-search-toggle,
.tcp-menu-toggle {
  background: none;
  border: none;
  padding: var(--tcp-space-2);
  cursor: pointer;
  color: var(--tcp-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tcp-search-toggle:hover,
.tcp-menu-toggle:hover {
  color: var(--tcp-primary);
}

.tcp-search-toggle svg,
.tcp-menu-toggle svg {
  width: 20px;
  height: 20px;
}

.tcp-menu-toggle {
  display: flex;
}

/* --- Mobile navigation --- */
.tcp-mobile-nav {
  display: none;
  background: var(--tcp-bg);
  border-top: 1px solid var(--tcp-border);
  padding: var(--tcp-space-4);
}

.tcp-mobile-nav.is-open {
  display: block;
}

.tcp-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tcp-mobile-nav-list li {
  border-bottom: 1px solid var(--tcp-border);
}

.tcp-mobile-nav-list li:last-child {
  border-bottom: none;
}

.tcp-mobile-nav-list a {
  display: block;
  padding: var(--tcp-space-3) 0;
  color: var(--tcp-text);
  text-decoration: none;
  font-weight: 500;
}

.tcp-mobile-nav-list a:hover {
  color: var(--tcp-primary);
}

/* --- Search overlay --- */
.tcp-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.8);
  z-index: 10001;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}

.tcp-search-overlay.is-open {
  display: flex;
}

.tcp-search-box {
  background: var(--tcp-bg);
  padding: var(--tcp-space-6);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tcp-search-box form {
  display: flex;
  gap: var(--tcp-space-2);
}

.tcp-search-box input[type="search"] {
  flex: 1;
  padding: var(--tcp-space-3) var(--tcp-space-4);
  border: 2px solid var(--tcp-border);
  border-radius: 6px;
  font-size: var(--tcp-fs-base);
  font-family: var(--tcp-font-body);
  color: var(--tcp-text);
}

.tcp-search-box input[type="search"]:focus {
  border-color: var(--tcp-primary);
  outline: none;
}

.tcp-search-box button[type="submit"] {
  padding: var(--tcp-space-3) var(--tcp-space-4);
  background: var(--tcp-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* --- Footer --- */
.tcp-footer {
  background: var(--tcp-text);
  color: #FFFFFF;
  padding: var(--tcp-space-16) 0 var(--tcp-space-8);
}

.tcp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--tcp-space-4);
}

.tcp-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--tcp-space-8);
  margin-bottom: var(--tcp-space-12);
}

.tcp-footer-col h3 {
  color: #FFFFFF;
  font-size: var(--tcp-fs-base);
  margin-bottom: var(--tcp-space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tcp-footer-col p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--tcp-fs-small);
  line-height: var(--tcp-lh-body);
}

.tcp-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tcp-footer-links li {
  margin-bottom: var(--tcp-space-2);
}

.tcp-footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--tcp-fs-small);
  transition: color 0.15s ease;
}

.tcp-footer-links a:hover,
.tcp-footer-links a:focus {
  color: #FFFFFF;
}

/* --- Newsletter signup in footer --- */
.tcp-newsletter-form {
  margin-top: var(--tcp-space-4);
}

.tcp-newsletter-form .tcp-input-group {
  display: flex;
  gap: var(--tcp-space-2);
}

.tcp-newsletter-form input[type="email"] {
  flex: 1;
  padding: var(--tcp-space-3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-size: var(--tcp-fs-small);
  font-family: var(--tcp-font-body);
}

.tcp-newsletter-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.tcp-newsletter-form input[type="email"]:focus {
  border-color: var(--tcp-accent);
  outline: none;
}

.tcp-newsletter-form button {
  padding: var(--tcp-space-3) var(--tcp-space-4);
  background: var(--tcp-accent);
  color: var(--tcp-text);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: var(--tcp-fs-small);
  cursor: pointer;
  white-space: nowrap;
}

.tcp-newsletter-form button:hover {
  background: #00b085;
}

.tcp-newsletter-form .tcp-privacy-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--tcp-space-2);
}

.tcp-newsletter-form .tcp-privacy-note a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
}

/* --- Footer bottom bar --- */
.tcp-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--tcp-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--tcp-space-4);
  align-items: center;
  text-align: center;
}

.tcp-footer-copyright {
  font-size: var(--tcp-fs-small);
  color: rgba(255, 255, 255, 0.5);
}

.tcp-footer-social {
  display: flex;
  gap: var(--tcp-space-4);
}

.tcp-footer-social a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.15s ease;
}

.tcp-footer-social a:hover {
  color: #FFFFFF;
}

.tcp-footer-social svg {
  width: 20px;
  height: 20px;
}

/* --- Comparison table --- */
.tcp-comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--tcp-space-6) 0;
  border: 1px solid var(--tcp-border);
  border-radius: 8px;
}

.tcp-comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.tcp-comparison-table thead {
  background: var(--tcp-bg-alt);
}

.tcp-comparison-table th,
.tcp-comparison-table td {
  padding: var(--tcp-space-3) var(--tcp-space-4);
  text-align: left;
  border-bottom: 1px solid var(--tcp-border);
  white-space: nowrap;
}

.tcp-comparison-table th[scope="col"] {
  font-size: var(--tcp-fs-small);
  font-weight: 600;
  color: var(--tcp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tcp-comparison-table th[scope="row"] {
  position: sticky;
  left: 0;
  background: var(--tcp-bg);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--tcp-space-2);
}

.tcp-comparison-table tbody tr:hover {
  background: var(--tcp-bg-alt);
}

.tcp-comparison-table tbody tr:last-child td,
.tcp-comparison-table tbody tr:last-child th {
  border-bottom: none;
}

.tcp-rating {
  color: var(--tcp-rating-star);
  font-weight: 600;
}

/* --- Utility classes --- */
.tcp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--tcp-space-4);
}

.tcp-content {
  max-width: 720px;
  margin: 0 auto;
}

.tcp-section {
  padding: var(--tcp-space-12) 0;
}

.tcp-section-alt {
  background: var(--tcp-bg-alt);
}

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

.tcp-text-small {
  font-size: var(--tcp-fs-small);
}

/* --- 9.4 Responsive breakpoints --- */

/* sm: 640px */
@media (min-width: 640px) {
  .tcp-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tcp-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* md: 768px */
@media (min-width: 768px) {
  .tcp-footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

/* lg: 1024px */
@media (min-width: 1024px) {
  .tcp-nav {
    display: block;
  }

  .tcp-menu-toggle {
    display: none;
  }

  .tcp-header-inner {
    padding: var(--tcp-space-4);
  }

  h1 { font-size: var(--tcp-fs-h1); }
}

/* Mobile heading scale-down */
@media (max-width: 1023px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}
