:root {
    --bg-main: #0b0f19;
    --bg-card: #151a28;
    --bg-code: #0d111a;
    --primary: #5865F2;
    --primary-glow: rgba(88, 101, 242, 0.4);
    --secondary: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #2ecc71;
    --border: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 50% 0%, #1a2235 0%, transparent 50%);
    color: var(--text-main);
    margin: 0; 
    padding: 30px 20px;
    min-height: 100vh;
}
/* Removes mobile tap highlight */
* {
    -webkit-tap-highlight-color: transparent !important;
}

/* Removes desktop/Android blue focus ring on inputs, textareas, and buttons */
input:focus, 
textarea:focus, 
button:focus, 
.module-header:focus,
*:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: rgba(255,255,255,0.1) !important; /* Keeps your dark theme border */
}

header { 
    text-align: center; 
    margin-bottom: 30px; 
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

header p { color: var(--text-muted); margin: 0; font-size: 1rem; }

/* --- Search Bar Styles --- */
.search-container {
    max-width: 800px;
    margin: 0 auto 30px auto;
    padding: 0;
    animation: fadeInDown 0.6s ease-out; /* Matches header animation */
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box; 
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(88, 101, 242, 0.2);
}

/* Module Card */
.module-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

/* Adds a stagger effect to the cards loading in */
.module-card:nth-child(1) { animation-delay: 0.1s; }
.module-card:nth-child(2) { animation-delay: 0.2s; }
.module-card:nth-child(3) { animation-delay: 0.3s; }

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(88, 101, 242, 0.3);
}

.module-header {
    padding: 20px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: 12px;
}

.module-header h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.module-header p { margin: 6px 0 0 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.4; }

.chevron {
    color: var(--text-muted);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

/* Active State for Module */
.module-card.active .chevron { transform: rotate(180deg); color: var(--primary); }
.module-card.active { border-left: 4px solid var(--primary); }

/* Accordion Animation using CSS Grid */
.blocks-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.module-card.active .blocks-wrapper { grid-template-rows: 1fr; }

.blocks-container { overflow: hidden; }
.blocks-content { padding: 0 20px 20px 20px; }

/* Individual Code Block */
.code-block-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    margin-top: 15px;
    border-radius: 8px;
    padding: 18px;
    transition: all 0.3s ease;
}

.block-title { 
    font-weight: 600; 
    margin-bottom: 12px; 
    color: var(--text-main); 
    display: flex;
    align-items: center;
    gap: 8px;
}

.block-title::before {
    content: ''; display: inline-block; width: 8px; height: 8px;
    background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* Unlock Button Styling */
.unlock-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; padding: 12px; border-radius: 6px;
    cursor: pointer; width: 100%; font-weight: 600; font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.unlock-btn:active { transform: translateY(0); }

/* Code Display Area */
.code-display {
    display: none;
    position: relative;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
    animation: fadeInScale 0.4s ease-out;
}

.code-display pre {
    margin: 0; overflow-x: auto; color: #a6e22e; 
    font-family: 'Fira Code', monospace; font-size: 0.9rem; line-height: 1.5;
}

/* Copy Button */
.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255, 255, 255, 0.1); color: var(--text-main);
    border: 1px solid var(--border); border-radius: 4px; 
    padding: 6px 12px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
    transition: all 0.2s ease; backdrop-filter: blur(4px);
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }
.copy-btn.copied { background: var(--accent); border-color: var(--accent); color: #000; }

/* Keyframes for Smooth Loading */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
button, .module-header, * {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* Make Prism.js background match Covolt theme */
pre[class*="language-"], code[class*="language-"] {
    background: transparent !important;
    text-shadow: none !important;
    font-family: 'Fira Code', monospace !important;
    font-size: 0.9rem !important;
}

/* --- Hamburger Menu & Sidebar Styles --- */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 15px auto;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.hamburger .line {
    width: 24px;
    height: 3px;
    background-color: #f8fafc;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Sidebar Container */
.side-menu {
    position: fixed;
    top: 0;
    left: -260px; /* Hides it off-screen to the left */
    width: 260px;
    height: 100vh;
    background-color: #0b0f19;
    border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease-in-out;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}

/* Slides the menu in when the 'open' class is added via JS */
.side-menu.open {
    left: 0;
}

.menu-header {
    padding: 25px 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #5865F2;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 10px;
}

.menu-item {
    padding: 15px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.menu-item:hover {
    background-color: #151a28;
    color: #f8fafc;
    border-left: 4px solid #5865F2;
    padding-left: 16px; /* Offset the border width so text doesn't jump */
}

/* Dark Background Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Fades in the overlay */
.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}
