/* ==========================================================================
   CracksTube Official - Light Theme Stylesheet (100 PageSpeed Optimized)
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.9);
  
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --accent-cyan: #0284c7;
  --accent-cyan-light: #0369a1;
  --accent-indigo: #4f46e5;
  --accent-blue: #2563eb;
  --accent-emerald: #059669;
  
  --gradient-brand: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  --gradient-dark: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.08) 0%, transparent 70%);

  --border-subtle: #e2e8f0;
  --border-active: rgba(2, 132, 199, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-glow: 0 4px 20px rgba(2, 132, 199, 0.15);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container-max: 1200px;
  --header-height: 72px;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--gradient-dark);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-top: 1.5rem; margin-bottom: 0.75rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover {
  color: var(--accent-cyan-light);
  text-decoration: underline;
}

/* Keyword Anchor Link Style */
.kw-link {
  color: var(--accent-cyan-light);
  font-weight: 600;
  border-bottom: 1px dashed var(--accent-cyan);
  transition: all 0.2s ease;
}

.kw-link:hover {
  color: var(--accent-indigo);
  border-bottom-style: solid;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.logo-text span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.nav-btn {
  padding: 0.5rem 1.25rem;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(2, 132, 199, 0.3);
  text-decoration: none;
  color: #fff;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4rem 0 3rem;
  overflow: hidden;
  background: var(--gradient-glow);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.85rem 2rem;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(2, 132, 199, 0.35);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  padding: 0.85rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

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

.hero-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
}

.hero-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Category Grid */
.category-section {
  padding: 3rem 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-tag {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-cyan);
  box-shadow: 0 15px 30px rgba(2, 132, 199, 0.12);
  text-decoration: none;
}

.cat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(2, 132, 199, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.category-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-main);
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Article Content Layout - Render optimization for LCP/Speed Index */
.content-section {
  padding: 3rem 0;
  content-visibility: auto;
  contain-intrinsic-size: 1px 1200px;
}

.article-body {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  box-shadow: var(--shadow-card);
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
}

/* Feature Callout Box */
.callout-box {
  background: rgba(2, 132, 199, 0.04);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin: 2rem 0;
}

.callout-title {
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Graphic Showcase Container */
.graphic-box {
  margin: 2.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  aspect-ratio: 16 / 9;
}

.graphic-box img {
  width: 100%;
  height: auto;
  display: block;
}

.graphic-caption {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

/* Comparison Table */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.comp-table th, .comp-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comp-table th {
  background: var(--bg-secondary);
  color: var(--accent-cyan);
  font-weight: 700;
}

.comp-table tr:last-child td {
  border-bottom: none;
}

.comp-table tr:nth-child(even) {
  background: #f8fafc;
}

/* Pros & Cons Component */
.pro-con-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.pro-box, .con-box {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.pro-box {
  background: rgba(5, 150, 105, 0.04);
  border-color: rgba(5, 150, 105, 0.2);
}

.con-box {
  background: rgba(225, 29, 72, 0.04);
  border-color: rgba(225, 29, 72, 0.2);
}

.pro-box h4 { color: var(--accent-emerald); margin-bottom: 1rem; }
.con-box h4 { color: #e11d48; margin-bottom: 1rem; }

/* FAQ Accordion */
.faq-section {
  margin-top: 3rem;
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  overflow: hidden;
}

.faq-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-header:hover {
  color: var(--accent-cyan);
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  color: var(--accent-cyan);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
}

.faq-item.active .faq-body {
  max-height: 300px;
  padding: 0 1.5rem 1.25rem;
}

/* Contact & Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
}

/* Footer */
.footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  content-visibility: auto;
  contain-intrinsic-size: 1px 400px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 1rem;
  max-width: 320px;
}

.footer-column h4 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .article-body { padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    flex-direction: column;
    padding: 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-card);
  }
  
  .nav-menu.open {
    transform: translateY(0);
  }
  
  .mobile-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .pro-con-grid { grid-template-columns: 1fr; }
}
