/* Custom ByteBook Theme */

:root {
    /* Modern color palette */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #ec4899;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --code-bg: #1e293b;
    --sidebar-bg: #0f172a;
    --content-bg: #1e1e2e;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Main background gradient */
body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
}

/* Sidebar styling */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar-scrollbox {
    background: transparent;
}

.chapter {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 4px 8px;
    padding: 8px 12px;
}

.chapter:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

.chapter.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Content area */
.content {
    background: var(--content-bg);
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Headers with gradient */
h1, h2, h3, h4, h5, h6 {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.4rem;
}

h3 {
    font-size: 1.5rem;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--accent-color);
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Code blocks */
pre {
    background: var(--code-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

code {
    background: var(--code-bg);
    color: #a5d6ff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

pre code {
    background: transparent;
    padding: 0;
}

/* Inline code in headers */
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    background: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Lists */
ul, ol {
    line-height: 1.8;
    color: var(--text-secondary);
}

li {
    margin: 0.5rem 0;
}

/* Checkboxes */
input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

/* Horizontal rules */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 2rem 0;
}

/* Navigation buttons */
.nav-chapters {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.nav-chapters:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Search bar */
#searchbar {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.8rem;
    transition: all 0.3s ease;
}

#searchbar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gradient-start);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Emoji enhancement */
.emoji {
    font-size: 1.2em;
    vertical-align: middle;
}

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

.content > * {
    animation: fadeIn 0.6s ease-out;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .sidebar, .nav-chapters {
        display: none;
    }
}
