/* Design System & Variables */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #e8e8f0;
  --text-secondary: #8888a8;
  --text-muted: #555570;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --accent-secondary: #ec4899;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }

/* Layout */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.w-100 { width: 100%; }

/* Background Glow */
.glow-bg {
  position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
  z-index: -1; pointer-events: none;
}

/* Components */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.hover-effect { transition: var(--transition); }
.hover-effect:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  border-color: rgba(139, 92, 246, 0.3);
}

.neon-text {
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px var(--accent-glow);
}

/* Navbar */
.navbar { padding: 1rem 0; position: sticky; top: 0; z-index: 100; border-radius: 0 0 var(--border-radius) var(--border-radius); border-top: none; }
.nav-content { display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-size: 1.5rem; font-weight: 700; }
.nav-search input {
  background: var(--bg-secondary); border: 1px solid var(--glass-border); color: #fff;
  padding: 0.5rem 1rem; border-radius: 20px; font-family: var(--font);
}
.nav-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* Hero Section */
.hero { padding: 6rem 0 4rem; text-align: center; }
.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; font-weight: 800; }
.hero .subtitle { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 3rem; }

/* Search Bar */
.search-container { position: relative; max-width: 600px; margin: 0 auto; }
.search-form { display: flex; align-items: center; position: relative; }
.search-icon { position: absolute; left: 1.5rem; color: var(--text-muted); font-size: 1.2rem; }
.search-form input {
  width: 100%; padding: 1.2rem 1.2rem 1.2rem 3.5rem; font-size: 1.1rem;
  background: var(--bg-secondary); border: 2px solid var(--glass-border);
  border-radius: 30px; color: #fff; font-family: var(--font);
  transition: var(--transition);
}
.search-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.search-btn {
  position: absolute; right: 0.5rem; background: var(--accent); color: #fff;
  border: none; padding: 0.8rem 1.5rem; border-radius: 25px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.search-btn:hover { background: var(--accent-light); box-shadow: 0 0 15px var(--accent-glow); }

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 10px;
  background: var(--bg-secondary); border: 1px solid var(--glass-border);
  border-radius: var(--border-radius); box-shadow: var(--shadow); z-index: 50;
  overflow: hidden; text-align: left;
}
.search-dropdown-item { padding: 1rem; display: block; border-bottom: 1px solid var(--glass-border); color: var(--text-primary); }
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover { background: var(--bg-card-hover); padding-left: 1.5rem; color: var(--accent-light); }
.search-dropdown-cat { font-size: 0.8rem; color: var(--accent); margin-bottom: 0.2rem; display: block; }

/* Grid Layouts */
.category-grid { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 4rem; }
.guides-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 4rem; }

/* Cards */
.category-card { padding: 1.2rem 1.5rem; display: flex; flex-direction: column; height: 100%; transition: var(--transition); border-left: 4px solid var(--accent); }
.category-card:hover { border-left-color: var(--accent-light); }
.category-icon { width: 50px; height: 50px; background: rgba(139, 92, 246, 0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--accent-light); margin-bottom: 1.5rem; }
.category-info h3 { font-size: 1.2rem; margin-bottom: 0; }
.category-info h3 a { color: var(--text-primary); display: block; width: 100%; }
.category-info h3 a:hover { color: var(--accent-light); padding-left: 5px; }
.guide-count { font-size: 0.9rem; color: var(--accent); font-weight: 600; display: inline-block; padding: 0.2rem 0.8rem; background: rgba(139, 92, 246, 0.1); border-radius: 20px; margin-bottom: 1rem; }
.category-desc { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

.recent-guides { border-top: 1px solid var(--glass-border); padding-top: 1rem; }
.recent-guides li { margin-bottom: 0.8rem; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-guides i { color: var(--text-muted); margin-right: 0.5rem; font-size: 0.8rem; }
.recent-guides .view-all { margin-top: 1rem; font-weight: 600; }
.recent-guides .view-all a { color: var(--accent); }
.recent-guides .view-all a:hover { color: var(--accent-light); padding-left: 5px; }

/* Guide List Item */
.guide-list-item { display: flex; align-items: center; padding: 1.5rem; text-decoration: none; color: var(--text-primary); }
.guide-icon { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.05); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); margin-right: 1.5rem; transition: var(--transition); }
.guide-list-item:hover .guide-icon { background: var(--accent); color: #fff; transform: scale(1.1); }
.guide-info { flex-grow: 1; }
.guide-info h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.guide-meta-sm { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 1rem; }
.guide-list-item .arrow { color: var(--text-muted); transition: var(--transition); }
.guide-list-item:hover .arrow { color: var(--accent-light); transform: translateX(5px); }

/* Guide Content Page */
.guide-layout { display: grid; grid-template-columns: 3fr 1fr; gap: 2rem; margin-bottom: 4rem; }
@media (max-width: 992px) { .guide-layout { grid-template-columns: 1fr; } }

.guide-content { padding: 3rem; }
.guide-header { margin-bottom: 2rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 2rem; }
.guide-header h1 { font-size: 2.5rem; margin-bottom: 1rem; line-height: 1.2; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.badge { background: rgba(139, 92, 246, 0.2); color: var(--accent-light); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; border: 1px solid rgba(139, 92, 246, 0.3); }
.meta-item { color: var(--text-muted); font-size: 0.9rem; }

/* HTML Content Styling */
.html-content h2 { font-size: 1.8rem; margin: 2rem 0 1rem; color: var(--accent-light); }
.html-content h3 { font-size: 1.4rem; margin: 1.5rem 0 1rem; }
.html-content p { margin-bottom: 1.2rem; line-height: 1.7; }
.html-content ul, .html-content ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.html-content li { margin-bottom: 0.5rem; }
.html-content img { max-width: 100%; border-radius: var(--border-radius); border: 1px solid var(--glass-border); margin: 1rem 0; }
.html-content pre { background: var(--bg-secondary); padding: 1.5rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid var(--glass-border); }
.html-content code { font-family: monospace; color: var(--accent-light); background: rgba(255,255,255,0.05); padding: 0.2rem 0.4rem; border-radius: 4px; }
.html-content pre code { color: inherit; background: transparent; padding: 0; }
.html-content blockquote { border-left: 4px solid var(--accent); padding: 1rem 1.5rem; background: rgba(139, 92, 246, 0.05); margin-bottom: 1.5rem; border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-secondary); }

/* Sidebar */
.sidebar-widget { padding: 1.5rem; margin-bottom: 2rem; }
.sidebar-widget h3 { font-size: 1.2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--glass-border); }
.sidebar-links li { margin-bottom: 0.8rem; }
.sidebar-links a { color: var(--text-secondary); display: block; }
.sidebar-links a:hover { color: var(--accent-light); padding-left: 5px; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 2rem; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb .separator { font-size: 0.7rem; margin: 0 0.5rem; }
.breadcrumb .current { color: var(--accent-light); }

/* Category Header */
.category-header { padding: 3rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; }
.category-title-wrap { display: flex; align-items: center; gap: 1.5rem; }
.accent-text { color: var(--accent-light); text-shadow: 0 0 15px var(--accent-glow); }

/* Filters Bar */
.filters-bar { display: flex; align-items: center; margin-bottom: 2rem; color: var(--text-muted); font-size: 0.95rem; }
.sort-links { display: flex; gap: 1rem; margin-left: 1rem; }
.sort-links a { color: var(--text-secondary); padding: 0.3rem 0.8rem; border-radius: 20px; background: var(--bg-card); transition: var(--transition); }
.sort-links a:hover, .sort-links a.active { background: var(--accent); color: #fff; }

/* Search Results */
.search-result-card { display: block; padding: 2rem; margin-bottom: 1.5rem; color: var(--text-primary); text-decoration: none; }
.result-badge { display: inline-block; font-size: 0.8rem; color: var(--accent); margin-bottom: 0.8rem; }
.search-result-card h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.result-excerpt { color: var(--text-secondary); font-size: 0.95rem; }
mark { background: rgba(139, 92, 246, 0.3); color: #fff; padding: 0 4px; border-radius: 3px; }

/* Footer */
footer { margin-top: auto; padding: 2rem 0; border-top: 1px solid var(--glass-border); }
.copyright { color: var(--text-muted); font-size: 0.9rem; cursor: pointer; user-select: none; transition: color 0.3s; }
.copyright:hover { color: var(--text-secondary); }

/* Buttons & Forms */
.btn { display: inline-block; padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: var(--transition); text-align: center; border: none; font-family: var(--font); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); box-shadow: 0 0 15px var(--accent-glow); }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent-light); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); }
.form-group input, .form-group textarea { width: 100%; padding: 0.8rem 1rem; background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: 8px; color: #fff; font-family: var(--font); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); }
.modal-content { background-color: var(--bg-primary); margin: 15% auto; padding: 2.5rem; border: 1px solid var(--glass-border); width: 100%; max-width: 400px; position: relative; animation: slideDown 0.3s ease-out; }
.close-modal { color: var(--text-muted); float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-modal:hover { color: #fff; }
.modal h2 { margin-bottom: 1.5rem; text-align: center; }
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Animations */
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn 0.5s ease-out forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Utils */
.d-none { display: none; }
