@import 'reset.css' layer(base);
@import 'solid.css' layer(theme);

@layer theme, base, framework, componenst, utilities;

@layer theme {
    :root {
        /* Основные цвета */
        --primary-bg: #f5f8fa;
        --primary-green: #4caf50;
        --primary-teal: #00796b;
        --primary-text: #333333;
        --error-red: #f44336;
        --warning-yellow: #ffc107;

        /* Дополнительные цвета */
        --white: #ffffff;
        --light-gray: #f8f9fa;
        --border-gray: #e0e0e0;
        --text-gray: #666666;
        --dark-bg: #333333;

        /* Градиенты */
        --hero-gradient: linear-gradient(135deg, var(--primary-teal), var(--primary-green));

        /* Тени */
        --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.1);
        --shadow-medium: 0 4px 15px rgba(76, 175, 80, 0.3);
        --shadow-heavy: 0 6px 20px rgba(76, 175, 80, 0.4);
        --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.15);

        /* Размеры */
        --border-radius: 8px;
        --border-radius-large: 12px;
        --container-max-width: 1200px;
    }
}

@layer base {
    body {
        font-family: 'IBM Plex Sans', sans-serif;
        line-height: 1.6;
        color: var(--primary-text);
        background-color: var(--primary-bg);
        font-variation-settings: 'wdth' 100;
    }
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--hero-gradient);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.hero {
    h1 {
        font-size: 3rem;
        margin-bottom: 20px;
        font-weight: 700;
    }

    p {
        font-size: 1.2rem;
        margin-bottom: 30px;
        opacity: 0.9;
    }
}

.download-btn {
    display: inline-block;
    background: var(--primary-green);
    color: var(--white);
    padding: 15px 30px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);

    @media (hover: hover) {
        &:hover {
            background: #45a049;
            transform: translateY(-2px);
            box-shadow: var(--shadow-heavy);
        }
    }
}

/* Navigation */
nav {
    background: var(--primary-teal);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;

    ul {
        list-style: none;
        display: flex;
        justify-content: center;
        gap: 30px;
    }

    a {
        color: var(--white);
        text-decoration: none;
        font-weight: 500;
        padding: 10px 15px;
        border-radius: 5px;
        transition: background 0.3s ease;

        @media (hover: hover) {
            &:hover {
                background: rgba(255, 255, 255, 0.1);
            }
        }
    }
}

/* Sections */
section {
    padding: 60px 0;
}

.section-title {
    color: var(--primary-teal);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--primary-teal);
    font-size: 1.8rem;
    margin: 30px 0 20px;
    font-weight: 600;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--white);
}

.feature-card h3 {
    color: var(--primary-teal);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Preview Image */
.preview-image {
    text-align: center;
    margin: 40px 0;
}

.preview-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-light);
}

.preview-caption {
    text-align: center;
    color: var(--text-gray);
    font-style: italic;
    margin-top: 15px;
}

/* Code Blocks */
.code-example {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--shadow-light);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-bg);
}

.code-title {
    color: var(--primary-teal);
    font-weight: 600;
    font-size: 1.2rem;
}

.copy-btn {
    background: var(--warning-yellow);
    color: var(--primary-text);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #ffb300;
}

pre {
    background: var(--light-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    border-left: 4px solid var(--primary-green);
}

code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Alert Boxes */
.alert {
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e8;
    border-color: var(--primary-green);
    color: #2e7d32;
}

.alert-warning {
    background: #fff8e1;
    border-color: var(--warning-yellow);
    color: #f57c00;
}

.alert-error {
    background: #ffebee;
    border-color: var(--error-red);
    color: #c62828;
}

/* Download Section */
.download-section {
    background: var(--white);
    border-radius: var(--border-radius-large);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-light);
}

.version-info {
    background: var(--primary-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.download-option {
    background: var(--primary-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
}

.download-option h4 {
    color: var(--primary-teal);
    margin-bottom: 15px;
}

/* Parameters Table */
.params-table {
    background: var(--white);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    margin: 30px 0;
}

.params-table table {
    width: 100%;
    border-collapse: collapse;
}

.params-table th {
    background: var(--primary-teal);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.params-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.param-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--light-gray);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary-teal);
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: var(--white);
    text-align: center;
    padding: 40px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .section-title {
        font-size: 2rem;
    }

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

@layer cookies {
    #cookies {
        position: fixed;
        bottom: 20px;
        left: 20px;
        background: hsl(0, 0%, 100%);
        border-radius: var(--border-radius-large);
        padding: 30px;
        max-width: 550px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        &.noshow {
            display: none;
        }

        #cookies-wrapper {
            display: flex;
            flex-direction: column;

            & > * + * {
                margin-top: 1rem;
            }

            .cookies-line {
                display: flex;
                align-items: center;
                gap: 20px;
            }

            #cookies-icon {
                display: flex;
                align-items: center;
                justify-content: center;
                background: var(--primary-green);
                width: 50px;
                height: 50px;
                border-radius: 50%;

                font-size: 1.5rem;
            }

            #cookies-title {
                font-weight: 700;
                font-size: 1.2rem;
            }

            #cookies-text {
                padding-left: calc(50px + 20px);
            }

            #cookies-btn-group {
                align-self: flex-end;
                display: flex;
                align-items: center;
                gap: 20px;

                button {
                    background: var(--primary-green);
                    color: var(--white);
                    padding: 10px 25px;
                    text-decoration: none;
                    border-radius: var(--border-radius);
                    font-weight: 600;
                    font-size: 1.1rem;
                    transition: all 0.3s ease;
                    box-shadow: var(--shadow-medium);

                    @media (hover: hover) {
                        &:hover {
                            background: hsl(123, 40%, 45%);
                            transform: translateY(-2px);
                            box-shadow: var(--shadow-heavy);
                        }
                    }
                }
            }
        }
    }
}

.flex-col {
    flex-direction: column;
}

.align-start {
    align-items: flex-start;
}