@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    --code-bg: #f1f3f5;
    --code-color: #d63384;
    --sidebar-bg: #ffffff;
    --hero-gradient: linear-gradient(135deg, #5b83c2 0%, #5fbcc9 100%);
    --nav-height: 60px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --border-color: #334155;
    --code-bg: #1e293b;
    --code-color: #38bdf8;
    --sidebar-bg: #0f172a;
    --hero-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
}

.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--nav-height);
}

.hero-section {
    background: var(--hero-gradient);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: var(--text-color);
    font-weight: 700;
}

.card-text {
    color: var(--secondary-color);
}

.badge-category {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 20px;
}

/* Code block styles */
code {
    background-color: var(--code-bg);
    color: var(--code-color);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: "Poppins", sans-serif;
}

pre {
    background-color: var(--code-bg);
    padding: 15px;
    border-radius: 8px;
    position: relative;
    border: 1px solid var(--border-color);
}

pre code {
    background-color: transparent;
    padding: 0;
    color: var(--text-color);
}

/* Copy button */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

pre:hover .copy-btn {
    opacity: 1;
}

/* Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 5px;
    /* Thinner scroll space */
}

/* Custom scrollbar for sidebar */
.sticky-sidebar::-webkit-scrollbar {
    width: 4px;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.sidebar-link {
    display: block;
    padding: 8px 15px;
    color: var(--secondary-color);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

/* Tables */
.table {
    color: var(--text-color);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.table td {
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

/* Dark mode toggle */
#theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .sticky-sidebar {
        position: static;
        height: auto;
        margin-bottom: 30px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }
}

/* Print styles for PDF */
@media print {

    .navbar,
    .hero-section,
    .footer,
    .sticky-sidebar,
    .no-print {
        display: none !important;
    }

    body {
        background-color: white !important;
        color: black !important;
    }

    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
    }

    pre {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
}