:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #0ea5e9;
    --accent-color: #8b5cf6;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --tag-basic: #22c55e;
    --tag-intermediate: #f59e0b;
    --tag-performance: #0ea5e9;
    --tag-advanced: #ef4444;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    --sidebar-width: 280px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --sidebar-active: #f1f5f9;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-color: #e2e8f0;
        --text-light: #94a3b8;
        --border-color: #334155;
        --card-bg: #1e293b;
        --info-bg: #0c4a6e;
        --info-border: #0284c7;
        --sidebar-bg: #1e293b;
        --sidebar-border: #334155;
        --sidebar-active: #2d3748;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
        "Helvetica Neue", sans-serif;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul,
ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

code {
    font-family: "Fira Code", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--code-bg);
    color: var(--code-text);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

pre code {
    background-color: transparent;
    padding: 0;
    font-size: inherit;
}

section {
    margin-bottom: 60px;
}

/* Page Layout with Sidebar */
.page-container {
    display: flex;
    min-height: calc(100vh - 180px);
    /* Adjust based on header/footer height */
    position: relative;
    ;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1000;
    padding-top: 20px;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
}

.sidebar::-webkit-scrollbar{
    display: none;
}
.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    border-bottom: none;
}

.sidebar-section {
    padding: 15px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-section h3 {
    font-size: 1rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
}

.sidebar-section .tag {
    margin-right: 8px;
    font-size: 0.7rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-active);
    text-decoration: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle.active {
    left: calc(var(--sidebar-width) + 20px);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* Desktop Styles */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .sidebar-toggle {
        display: none;
    }
}

.intro {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.info-box {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.hooks-overview {
    margin-bottom: 40px;
}

.legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.tag.basic {
    background-color: var(--tag-basic);
}

.tag.intermediate {
    background-color: var(--tag-intermediate);
}

.tag.performance {
    background-color: var(--tag-performance);
}

.tag.advanced {
    background-color: var(--tag-advanced);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.hook-link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.hook-link:hover {
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

.hook-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hook-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hook-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hook-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hook-content {
    padding: 20px;
}

.hook-description {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.hook-syntax,
.hook-example,
.hook-details,
.hook-best-practices {
    margin-bottom: 25px;
}

.hook-best-practices {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

abbr {
    text-decoration: underline dotted;
    cursor: help;
}

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* Responsive styles */
@media (max-width: 768px) {
    header {
        padding: 40px 0;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    .hook-description {
        font-size: 1rem;
    }

    pre {
        font-size: 0.8rem;
    }

    .main-content {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 0;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .hook-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hook-header h3 {
        margin-bottom: 10px;
    }

    .main-content {
        padding: 15px 10px;
    }
}