:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    --bg-color-light: #f8fafc;
    --text-color-light: #1f2937;
    --border-color-light: #e5e7eb;
    --code-bg-light: #f1f5f9;
    --section-bg-light: rgba(255, 255, 255, 0.8);
    --nav-bg-light: rgba(255, 255, 255, 0.85);

    --bg-color-dark: #0f172a;
    --text-color-dark: #e2e8f0;
    --border-color-dark: #334155;
    --code-bg-dark: #1e293b;
    --section-bg-dark: rgba(30, 41, 59, 0.8);
    --nav-bg-dark: rgba(15, 23, 42, 0.85);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), #059669);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root {
    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color-light);
    --border-color: var(--border-color-light);
    --code-bg: var(--code-bg-light);
    --section-bg: var(--section-bg-light);
    --nav-bg: var(--nav-bg-light);
}

html.dark {
    --bg-color: var(--bg-color-dark);
    --text-color: var(--text-color-dark);
    --border-color: var(--border-color-dark);
    --code-bg: var(--code-bg-dark);
    --section-bg: var(--section-bg-dark);
    --nav-bg: var(--nav-bg-dark);

    .theme-toggle {
        .sun-icon {
            transform: scale(0);
            opacity: 0;
        }

        .moon-icon {
            transform: scale(1);
            opacity: 1;
        }
    }

    :is(h1, h2, h3) {
        color: var(--primary-color);
    }

    .feature-icon {
        color: var(--primary-color);
    }

    .alert-info {
        background-color: rgba(59, 130, 246, 0.15);
    }

    .alert-warning {
        background-color: rgba(245, 158, 11, 0.15);
    }

    .alert-success {
        background-color: rgba(16, 185, 129, 0.15);
    }

    :is(p, [p]) a {
        color: lightseagreen;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style-position: inside;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-attachment: fixed;
    transition: var(--transition);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

header {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%);
        animation: rotate 40s linear infinite;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    animation: slideInUp 0.8s ease-out;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);

    &:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

nav {
    background: var(--nav-bg);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    flex-wrap: wrap;

    a {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        position: relative;
        transition: var(--transition);

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 2px;
            background: var(--gradient-primary);
            transform: translateX(-50%);
            transition: var(--transition);
            border-radius: 2px;
        }

        &:hover,
        &.active {
            color: var(--primary-color);
            background: rgba(59, 130, 246, 0.1);

            &::after {
                width: 80%;
            }
        }
    }
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;

    &:hover {
        background: rgba(59, 130, 246, 0.1);
    }

    svg {
        position: absolute;
        width: 20px;
        height: 20px;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
        color: var(--text-color);
    }

    .sun-icon {
        transform: scale(1);
        opacity: 1;
    }

    .moon-icon {
        transform: scale(0);
        opacity: 0;
    }
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;

    .bar {
        width: 25px;
        height: 3px;
        background-color: var(--text-color);
        border-radius: 2px;
        transition: all 0.3s ease-in-out;
    }
}

main {
    padding: 3rem 0;
    animation: fadeIn 1s ease-out;
}

.section {
    margin-bottom: 4rem;
    background: var(--section-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);

    &:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
    }
}

h1,
h2,
h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 1rem;

    &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 50px;
        height: 3px;
        background: var(--gradient-primary);
        border-radius: 3px;
    }
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-block: 1rem 0.37rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

pre {
    background: var(--code-bg);
    padding: 1.5rem;
    padding-top: 2.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: var(--shadow-sm);

    &::before {
        content: '';
        position: absolute;
        top: 0.75rem;
        left: 1rem;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #ff5f56;
        box-shadow: 20px 0 #ffbd2e, 40px 0 #27ca3f;
    }
}

code {
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
    font-size: 0.9rem;
}

.inline-code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    text-wrap-mode: nowrap;

    &.wrap {
        display: inline-block;
        transform: translateY(-0.5ch);
        margin-inline: 0.5ch;
    }
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

.feature-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);

    &:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-color);

        .feature-icon {
            transform: scale(1.1);
            color: var(--primary-color);
        }
    }
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    display: inline-block;
    color: var(--secondary-color);
}



.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.options-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;

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

    th {
        background: var(--code-bg);
        font-weight: 600;
        color: var(--secondary-color);


        html.dark & {
            color: var(--primary-color);
        }
    }


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

        &:hover {
            background-color: rgba(59, 130, 246, 0.05);
        }
    }

}

.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    border: 1px solid transparent;
    position: relative;
    border-left-width: 4px;
}

.alert-info {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.alert-warning {
    border-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.alert-success {
    border-color: var(--accent-color);
    background-color: rgba(16, 185, 129, 0.1);
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;

    &.visible {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }

    &:hover {
        transform: scale(1.1) translateY(-3px);
        box-shadow: 0 15px 25px -5px rgba(30, 64, 175, 0.4);
    }
}

.github-link {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-color);
    transition: var(--transition);

    &:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--primary-color);
    }

}


@media (width <=992px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-color);
        box-shadow: var(--shadow-lg);
        padding: 1rem 0;
        gap: 0;
        border-top: 1px solid var(--border-color);

        &.active {
            display: flex;
            animation: slideInUp 0.3s ease-out;
        }

        a {
            display: block;
            padding: 1rem;
            text-align: center;
            margin: 0.25rem 1rem;
        }
    }

    .nav-controls {
        margin-left: auto;
    }

    .hamburger-menu {
        display: flex;
    }

    body.nav-open .hamburger-menu {
        .bar {
            &:nth-child(1) {
                transform: rotate(45deg) translate(5px, 5px);
            }

            &:nth-child(2) {
                opacity: 0;
            }

            &:nth-child(3) {
                transform: rotate(-45deg) translate(7px, -6px);
            }
        }

    }
}

@media (width <=768px) {
    .container {
        padding: 0 15px;
    }

    .section {
        padding: 2rem 1.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    header {
        padding: 2.5rem 0;
    }
}