/* Affiliate Traffic Experiments Styles */

/* CSS Variables */
:root {
  --primary-color: #00d4aa;
  --primary-dark: #00a88a;
  --secondary-color: #1a1a2e;
  --accent-color: #ff6b35;
  --background-dark: #0f0f1a;
  --background-card: #1e1e32;
  --background-light: #2a2a42;
  --text-primary: #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted: #8888a0;
  --border-color: #333350;
  --success-color: #00d4aa;
  --warning-color: #ffc107;
  --error-color: #ff4757;
  --gradient-primary: linear-gradient(135deg, #00d4aa 0%, #00a88a 100%);
  --gradient-dark: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--background-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 2.5rem; }
h3 { font-size: 1.5rem; margin-top: 2rem; }
h4 { font-size: 1.25rem; }

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

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

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

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.nav a:hover,
.nav a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  background: var(--gradient-dark);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

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

.hero-meta span::before {
  content: '•';
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.hero-meta span:first-child::before {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--background-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--background-dark);
}

.btn-secondary {
  background: var(--background-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--background-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  font-weight: 600;
}

.card h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

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

/* Section Styles */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Article Page Styles */
.article-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.article-main {
  min-width: 0;
}

.article-content {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
}

.article-content h2 {
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-top: 2.5rem;
}

.article-content h3 {
  color: var(--primary-color);
  margin-top: 2rem;
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.article-content blockquote {
  background: var(--background-light);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content code {
  background: var(--background-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
  color: var(--primary-color);
}

.article-content pre {
  background: var(--background-light);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.article-content th,
.article-content td {
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.article-content th {
  background: var(--background-light);
  font-weight: 600;
  color: var(--text-primary);
}

.article-content tr:hover {
  background: var(--background-light);
}

/* Table of Contents */
.toc {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 100px;
}

.toc h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.toc ul {
  list-style: none;
  padding: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem 0;
  transition: var(--transition-fast);
}

.toc a:hover {
  color: var(--primary-color);
  padding-left: 0.5rem;
}

.toc .toc-h3 {
  padding-left: 1rem;
  font-size: 0.85rem;
}

/* Related Articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-articles h3 {
  margin-bottom: 1.5rem;
}

/* Author Box */
.author-box {
  background: var(--background-light);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.author-avatar {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--background-dark);
  font-weight: 700;
  flex-shrink: 0;
}

.author-info h4 {
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.author-info p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* Homepage Specific */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.featured-card {
  grid-row: span 2;
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition-normal);
}

.featured-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
}

.featured-card-image {
  height: 250px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--background-dark);
}

.featured-card-content {
  padding: 1.5rem;
}

.featured-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.featured-card p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.sidebar-card {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.sidebar-card h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-card ul {
  list-style: none;
  padding: 0;
}

.sidebar-card li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-card li:last-child {
  border-bottom: none;
}

.sidebar-card a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.sidebar-card a:hover {
  color: var(--primary-color);
}

/* Categories */
.category-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-nav a {
  padding: 0.5rem 1.25rem;
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.category-nav a:hover,
.category-nav a.active {
  background: var(--gradient-primary);
  color: var(--background-dark);
  border-color: transparent;
}

/* CTA Section */
.cta-section {
  background: var(--gradient-dark);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  background: var(--secondary-color);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9rem;
}

.footer h5 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer li {
  margin-bottom: 0.5rem;
}

.footer a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

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

.breadcrumb span {
  color: var(--primary-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* Responsive Design */
@media (max-width: 1024px) {
  .article-container {
    grid-template-columns: 1fr;
  }
  
  .toc {
    position: static;
    margin-bottom: 2rem;
  }
  
  .featured-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .article-content {
    padding: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-brand {
    max-width: 100%;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .author-box {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .hero-meta span::before {
    display: none;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .toc,
  .related-articles,
  .cta-section {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .article-content {
    border: none;
    padding: 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.animate-pulse {
  animation: pulse 2s ease infinite;
}

/* Exit Popup Styles */
.exit-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.exit-popup.show {
  opacity: 1;
  visibility: visible;
}

.exit-popup-content {
  background: var(--background-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 480px;
  width: 90%;
  position: relative;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.exit-popup.show .exit-popup-content {
  transform: translateY(0);
}

.exit-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s ease;
}

.exit-popup-close:hover {
  color: var(--text-primary);
}

.exit-popup-body {
  padding: 2.5rem;
  text-align: center;
}

.exit-popup-body h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.exit-popup-body p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.exit-popup-offer {
  background: var(--background-light);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.optin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.optin-form input[type="email"] {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--background-dark);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

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

.optin-form .btn {
  width: 100%;
  justify-content: center;
}

.exit-popup-privacy {
  font-size: 0.85rem;
  color: var(--text-muted) !important;
  margin-bottom: 0 !important;
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .exit-popup-body {
    padding: 1.5rem;
  }
  
  .exit-popup-body h3 {
    font-size: 1.25rem;
  }
}
