/* TheLastWeb - Complete Stylesheet */
:root {
  --bg: #000;
  --bg-alt: #0a0a0a;
  --bg-dark: #050505;
  --accent: #9fff00;
  --accent-dark: #7acc00;
  --secondary: #00d4ff;
  --warning: #ff6b35;
  --muted: #888;
  --text: #e0e0e0;
  --white: #fff;
  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, sans-serif; line-height: 1.6; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; max-width: var(--container); margin: 0 auto; }
.nav-brand { font-size: 1.4rem; font-weight: 700; color: var(--white); text-decoration: none; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--white); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; font-size: 15px; font-weight: 600; text-decoration: none; border-radius: var(--radius-sm); transition: all var(--transition); cursor: pointer; border: 2px solid transparent; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(159,255,0,0.3); }
.btn-secondary { background: var(--secondary); color: var(--bg); }
.btn-secondary:hover { background: #00b8d9; }
.btn-accent { background: var(--warning); color: var(--white); }
.btn-accent:hover { background: #e55a2b; }
.btn-outline { background: transparent; color: var(--white); border-color: #333; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Hero Section */
.hero-section { background: linear-gradient(135deg, var(--bg) 0%, #0d1a00 50%, var(--bg) 100%); padding: 40px 0 80px; border-bottom: 1px solid #1a1a1a; }
.hero-content { text-align: center; padding-top: 40px; }
.badge { display: inline-block; background: rgba(159,255,0,0.15); color: var(--accent); padding: 8px 20px; border-radius: 50px; font-size: 14px; font-weight: 600; margin-bottom: 24px; border: 1px solid rgba(159,255,0,0.3); }
.hero-content h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; color: var(--white); margin-bottom: 16px; line-height: 1.2; }
.subtitle { font-size: 1.1rem; color: var(--muted); max-width: 600px; margin: 0 auto 32px; }
.stats-bar { display: flex; justify-content: center; gap: 40px; margin-bottom: 32px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); }
.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Page Header */
.page-header { background: var(--bg-alt); padding: 40px 0; border-bottom: 1px solid #1a1a1a; }
.page-header h1 { font-size: 2rem; color: var(--white); margin-bottom: 8px; }
.page-header p { color: var(--muted); }
.breadcrumb { font-size: 14px; margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--white); }

/* Sections */
.section { padding: 80px 0; }
.section-dark { background: var(--bg-alt); }
.section h2 { font-size: 1.8rem; color: var(--white); margin-bottom: 16px; }
.section-intro { color: var(--muted); margin-bottom: 40px; max-width: 700px; }
.text-center .section-intro { margin-left: auto; margin-right: auto; }

/* Category Grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.category-card { background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 24px; text-decoration: none; transition: all var(--transition); }
.category-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.category-emoji { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.category-card h3 { color: var(--white); margin-bottom: 8px; }
.category-card p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.article-count { color: var(--accent); font-size: 13px; font-weight: 600; }

/* Article Grid */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.article-card { background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 24px; text-decoration: none; transition: all var(--transition); }
.article-card:hover { border-color: var(--accent); }
.article-category { font-size: 12px; color: var(--accent); margin-bottom: 8px; display: block; }
.article-card h3 { color: var(--white); margin-bottom: 8px; font-size: 1.1rem; }
.article-card p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.article-meta { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }

/* Articles List */
.articles-list { display: flex; flex-direction: column; gap: 16px; }
.article-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 20px 24px; text-decoration: none; transition: all var(--transition); }
.article-row:hover { border-color: var(--accent); }
.article-info { flex: 1; }
.article-info h3 { color: var(--white); margin-bottom: 4px; }
.article-info p { color: var(--muted); font-size: 14px; }
.article-stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.no-articles { text-align: center; padding: 60px; color: var(--muted); }
.no-articles a { color: var(--accent); }

/* Browse Layout */
.browse-layout { display: grid; grid-template-columns: 250px 1fr; gap: 40px; }
.sidebar h3 { color: var(--white); margin-bottom: 16px; font-size: 1rem; }
.category-list { list-style: none; }
.category-list li { margin-bottom: 8px; }
.category-list a { color: var(--muted); text-decoration: none; display: flex; justify-content: space-between; padding: 8px 12px; border-radius: var(--radius-sm); transition: all var(--transition); }
.category-list a:hover { background: var(--bg-alt); color: var(--white); }
.category-list .count { color: var(--accent); }
.sort-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; color: var(--muted); }
.sort-bar select { background: var(--bg-dark); border: 1px solid #333; color: var(--white); padding: 8px 12px; border-radius: var(--radius-sm); }

/* Search */
.search-box { margin-top: 24px; position: relative; }
.search-box input { width: 100%; max-width: 500px; padding: 14px 20px; background: var(--bg-dark); border: 1px solid #333; border-radius: var(--radius); color: var(--white); font-size: 16px; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-results { position: absolute; top: 100%; left: 0; right: 0; max-width: 500px; background: var(--bg-dark); border: 1px solid #333; border-radius: var(--radius); margin-top: 8px; max-height: 400px; overflow-y: auto; display: none; }
.search-results.active { display: block; }
.search-result-item { padding: 12px 20px; border-bottom: 1px solid #222; cursor: pointer; }
.search-result-item:hover { background: var(--bg-alt); }

/* Article Page */
.article-page { padding: 40px 0 80px; }
.article-intro { margin-bottom: 40px; }
.article-intro h1 { font-size: 2.2rem; color: var(--white); margin-bottom: 16px; }
.article-actions { display: flex; gap: 12px; margin-top: 16px; }
.article-section { background: var(--bg-dark); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; }
.article-section h2 { font-size: 1.3rem; color: var(--accent); margin-bottom: 16px; }
.section-content { color: var(--text); line-height: 1.8; }
.section-content p { margin-bottom: 12px; }
.section-content li { margin-bottom: 8px; margin-left: 20px; }
.warning-section { border-left: 4px solid var(--warning); }
.theory-section { border-left: 4px solid var(--secondary); }
.article-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 40px; border-top: 1px solid #222; flex-wrap: wrap; gap: 24px; }
.article-id { font-size: 13px; color: var(--muted); }
.article-support p { color: var(--muted); margin-bottom: 12px; }
.difficulty { padding: 4px 12px; border-radius: 20px; font-size: 12px; text-transform: capitalize; }
.difficulty.beginner { background: rgba(0,212,255,0.2); color: var(--secondary); }
.difficulty.intermediate { background: rgba(159,255,0,0.2); color: var(--accent); }
.difficulty.advanced { background: rgba(255,107,53,0.2); color: var(--warning); }
.difficulty.expert { background: rgba(255,53,53,0.2); color: #ff5555; }

/* Contribute Form */
.contribute-form { max-width: 800px; }
.form-section { background: var(--bg-dark); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; }
.form-section h3 { color: var(--white); margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: var(--white); margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; background: var(--bg); border: 1px solid #333; border-radius: var(--radius-sm); color: var(--white); font-size: 15px; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group small { color: var(--muted); font-size: 13px; margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.form-actions { display: flex; gap: 16px; margin-top: 24px; }
#form-message { margin-top: 16px; padding: 16px; border-radius: var(--radius-sm); }
#form-message.success { background: rgba(159,255,0,0.1); color: var(--accent); }
#form-message.error { background: rgba(255,53,53,0.1); color: #ff5555; }
.info-box { background: var(--bg-dark); border-radius: var(--radius); padding: 24px; margin-bottom: 32px; border-left: 4px solid var(--accent); }
.info-box h3 { color: var(--white); margin-bottom: 12px; }
.info-box ul { margin-left: 20px; color: var(--muted); }
.info-box li { margin-bottom: 8px; }

/* Download Page */
.download-hero { margin-bottom: 60px; }
.download-box { background: linear-gradient(135deg, var(--bg-dark), #0a1500); border: 2px solid var(--accent); border-radius: var(--radius); padding: 48px; text-align: center; max-width: 500px; margin: 0 auto; }
.download-icon { font-size: 4rem; margin-bottom: 16px; }
.download-box h2 { color: var(--white); margin-bottom: 8px; }
.download-box > p { color: var(--muted); margin-bottom: 24px; }
.download-contents { list-style: none; text-align: left; margin-bottom: 24px; }
.download-contents li { padding: 8px 0; border-bottom: 1px solid #1a1a1a; color: var(--text); }
.category-downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 60px; }
.category-download-card { display: flex; align-items: center; gap: 16px; background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 16px 20px; }
.category-download-card .emoji { font-size: 2rem; }
.category-download-card .info { flex: 1; }
.category-download-card h4 { color: var(--white); margin-bottom: 4px; }
.category-download-card span { color: var(--muted); font-size: 13px; }
.print-section { text-align: center; padding: 40px; background: var(--bg-dark); border-radius: var(--radius); }
.print-section h3 { color: var(--white); margin-bottom: 12px; }
.print-section p { color: var(--muted); margin-bottom: 24px; }
.print-actions { display: flex; justify-content: center; gap: 16px; }

/* Support Page */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 32px; margin-bottom: 60px; }
.support-card { background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 40px; text-align: center; }
.support-card.featured { border-color: var(--accent); }
.support-icon { font-size: 3rem; margin-bottom: 16px; }
.support-card h2 { color: var(--white); margin-bottom: 12px; }
.support-card > p { color: var(--muted); margin-bottom: 24px; }
.support-card ul { list-style: none; margin-bottom: 24px; text-align: left; }
.support-card li { padding: 8px 0; color: var(--text); padding-left: 24px; position: relative; }
.support-card li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }
.usb-tiers { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; justify-content: center; }
.usb-tier { background: var(--bg); padding: 16px; border-radius: var(--radius-sm); flex: 1; min-width: 100px; }
.usb-tier h4 { color: var(--white); font-size: 14px; margin-bottom: 4px; }
.usb-tier .price { color: var(--accent); font-size: 1.4rem; font-weight: 700; }
.usb-tier p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.usb-tier.featured { border: 1px solid var(--accent); }
.usb-single { background: var(--bg); border: 2px solid var(--accent); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; text-align: center; }
.usb-price { color: var(--accent); font-size: 3rem; font-weight: 800; margin-bottom: 16px; }
.usb-features h4 { color: var(--white); margin-bottom: 12px; font-size: 1.1rem; }
.usb-features ul { list-style: none; text-align: left; margin: 0 auto; max-width: 280px; }
.usb-features li { padding: 6px 0; color: var(--text); font-size: 14px; }
.contributors-cta { text-align: center; padding: 40px; background: var(--bg-dark); border-radius: var(--radius); }
.contributors-cta h3 { color: var(--white); margin-bottom: 8px; }
.contributors-cta p { color: var(--muted); margin-bottom: 16px; }

/* Contributors Page */
.contributors-list { max-width: 700px; margin: 0 auto; }
.contributor-row { display: flex; align-items: center; gap: 20px; background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px; }
.contributor-row.top-1 { border-color: gold; background: linear-gradient(90deg, rgba(255,215,0,0.1), var(--bg-dark)); }
.contributor-row.top-2 { border-color: silver; }
.contributor-row.top-3 { border-color: #cd7f32; }
.rank { font-size: 1.5rem; font-weight: 700; color: var(--accent); min-width: 40px; }
.contributor-info { flex: 1; }
.contributor-info h3 { color: var(--white); margin-bottom: 4px; }
.contributor-info .badge { font-size: 12px; color: var(--accent); }
.contributor-stats { display: flex; gap: 16px; color: var(--muted); font-size: 14px; }

/* Format Grid */
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.format-item { background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius-sm); padding: 16px; }
.format-item span { font-size: 1.5rem; margin-right: 8px; }

/* Resilience Grid */
.resilience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; max-width: 1000px; margin: 0 auto; }
.scenario-card { background: var(--bg-dark); border: 1px solid #1a1a1a; border-radius: var(--radius); padding: 24px; text-align: center; }
.scenario-icon { font-size: 2.5rem; margin-bottom: 12px; }
.scenario-card h4 { color: var(--white); margin-bottom: 8px; }
.scenario-card p { color: var(--muted); font-size: 14px; }

/* CTA Section */
.cta-section { background: linear-gradient(135deg, #0a1500 0%, var(--bg) 50%, #001a1a 100%); border-top: 1px solid #1a1a1a; }
.cta-section h2 { font-size: 2rem; }
.cta-section p { color: var(--muted); margin-bottom: 24px; }
.cta-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: var(--bg-dark); border-top: 1px solid #1a1a1a; padding: 40px 0 0; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; padding-bottom: 40px; }
.footer-brand h3 { color: var(--accent); margin-bottom: 8px; }
.footer-brand p { color: var(--muted); font-size: 14px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { text-align: center; padding: 20px; background: var(--bg); font-size: 13px; color: #666; }

/* 404 Page */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.error-page h1 { font-size: 6rem; color: var(--accent); margin-bottom: 16px; }
.error-page p { color: var(--muted); margin-bottom: 32px; }
.error-page .btn { margin: 0 8px; }

/* Print Styles */
@media print {
  body { background: #fff; color: #000; }
  .nav, .site-footer, .btn, .article-actions { display: none; }
  .section { padding: 20px 0; }
  .article-section { border: 1px solid #ccc; background: #fff; }
}

/* Responsive */
@media (max-width: 900px) {
  .browse-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .nav { flex-direction: column; gap: 16px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .hero-content h1 { font-size: 1.8rem; }
  .stats-bar { gap: 24px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .article-footer { flex-direction: column; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .btn { padding: 10px 18px; font-size: 14px; }
  .category-grid, .article-grid { grid-template-columns: 1fr; }
}
