:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #06b6d4;
    --dark: #0f172a;
    --dark-blue: #102a43;
    --text: #334155;
    --muted: #64748b;
    --white: #ffffff;
    --background: #f4f7fb;
    --surface: #ffffff;
    --border: #e2e8f0;
    --success: #059669;
    --code-background: #0f172a;
    --code-text: #e2e8f0;
    --shadow-sm: 0 4px 15px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.7;
}

a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

header {
    position: relative;
    width: 100%;
    padding: 80px 20px 100px;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        #071a2f 0%,
        #0b3b70 55%,
        #0b5ed7 100%
    );
    color: var(--white);
    text-align: center;
}

header::before,
header::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

header::before {
    width: 380px;
    height: 380px;
    top: -190px;
    left: -100px;
    background: rgba(255, 255, 255, 0.05);
}

header::after {
    width: 320px;
    height: 320px;
    right: -120px;
    bottom: -180px;
    background: rgba(6, 182, 212, 0.1);
}

header h1 {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto 16px;
    color: var(--white);
    font-size: clamp(38px, 7vw, 58px);
    line-height: 1.1;
    letter-spacing: -1.5px;
}

header p {
    position: relative;
    z-index: 1;
    width: min(100%, 700px);
    margin: 0 auto;
    color: #dbeafe;
    font-size: 18px;
    line-height: 1.7;
}

.course-progress-box {
    position: relative;
    z-index: 5;
    width: min(92%, 1100px);
    margin: -35px auto 50px;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.course-progress-box h2 {
    margin-bottom: 20px;
    color: var(--dark-blue);
    font-size: clamp(25px, 4vw, 34px);
    line-height: 1.2;
}

.progress-bar {
    width: 100%;
    height: 14px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

#course-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary)
    );
    border-radius: inherit;
    transition: width 0.5s ease;
}

#progress-text {
    margin-top: 14px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
}

#course-percentage {
    margin-top: 8px;
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
}

main {
    width: min(92%, 1000px);
    margin: 0 auto 80px;
}

main > section {
    margin-bottom: 28px;
    padding: 42px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

main > section > h2 {
    margin-bottom: 18px;
    color: var(--dark-blue);
    font-size: clamp(27px, 4vw, 34px);
    line-height: 1.25;
}

main > section > p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

main > section > p + p {
    margin-top: 15px;
}

.lesson {
    scroll-margin-top: 25px;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.lesson:hover {
    border-color: #bfdbfe;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lesson h2 {
    color: var(--dark-blue);
    font-size: clamp(25px, 4vw, 31px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.lesson h3 {
    margin: 30px 0 12px;
    color: var(--primary);
    font-size: 20px;
    line-height: 1.35;
}

.lesson p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
    overflow-wrap: break-word;
}

.lesson p + p {
    margin-top: 15px;
}

.lesson ul,
.lesson ol {
    margin: 18px 0;
    padding-left: 25px;
}

.lesson li {
    margin-bottom: 9px;
    color: #475569;
    font-size: 15px;
    overflow-wrap: break-word;
}

.lesson li::marker {
    color: var(--primary);
}

pre {
    width: 100%;
    max-width: 100%;
    margin: 22px 0;
    padding: 24px;
    overflow-x: auto;
    background: var(--code-background);
    border: 1px solid #1e293b;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    color: var(--code-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre;
    tab-size: 4;
    -webkit-overflow-scrolling: touch;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

.lesson img {
    width: min(100%, 300px);
    margin: 25px auto;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
}

.lesson table {
    width: 100%;
    margin: 25px 0;
    border: 1px solid var(--border);
    border-spacing: 0;
    overflow: hidden;
    background: var(--white);
    border-radius: 12px;
}

.lesson th {
    padding: 14px 15px;
    background: var(--dark-blue);
    color: var(--white);
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
}

.lesson td {
    padding: 13px 15px;
    border-top: 1px solid var(--border);
    color: #475569;
    font-size: 14px;
}

.lesson tr:nth-child(even) td {
    background: #f8fafc;
}

.lesson tr:hover td {
    background: #eff6ff;
}

.lesson form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 650px);
    margin: 25px auto;
}

.lesson form label {
    margin-top: 7px;
    color: var(--dark-blue);
    font-size: 14px;
    font-weight: 700;
}

.lesson form input,
.lesson form textarea,
.lesson form select {
    width: 100%;
    max-width: 100%;
    padding: 13px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    outline: none;
    background: #f8fafc;
    color: var(--dark);
    font-size: 15px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.lesson form input {
    min-height: 48px;
}

.lesson form textarea {
    min-height: 120px;
    resize: vertical;
}

.lesson form input:focus,
.lesson form textarea:focus,
.lesson form select:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09);
}

.complete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    max-width: 100%;
    margin-top: 25px;
    padding: 11px 21px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary)
    );
    color: var(--white);
    font-size: 14px;
    font-weight: 800;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.complete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 22px rgba(37, 99, 235, 0.2);
}

.complete-btn.completed {
    background: linear-gradient(
        135deg,
        #059669,
        #10b981
    );
}

.complete-btn:disabled {
    cursor: default;
    opacity: 0.9;
    transform: none;
    box-shadow: none;
}

.lesson > a {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    margin-top: 25px;
    margin-left: 14px;
    font-size: 14px;
}

main > section:last-of-type ul {
    margin: 18px 0 0;
    padding-left: 25px;
}

main > section:last-of-type li {
    margin-bottom: 9px;
    color: #475569;
}

.course-navigation {
    text-align: center;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 25px;
}

.navigation-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--dark-blue);
    color: var(--white);
    font-size: 14px;
    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.navigation-buttons a:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

footer {
    margin-top: 60px;
    padding: 35px 20px;
    background: #071a2f;
    color: var(--white);
    text-align: center;
}

footer p {
    margin: 4px 0;
    color: #94a3b8;
    font-size: 13px;
}

@media (max-width: 800px) {
    .course-progress-box {
        width: 94%;
    }

    main {
        width: 94%;
    }

    main > section {
        padding: 30px 25px;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .navigation-buttons a {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    header {
        padding: 60px 18px 75px;
    }

    header h1 {
        font-size: 34px;
        letter-spacing: -0.8px;
    }

    header p {
        font-size: 15px;
    }

    .course-progress-box {
        width: 94%;
        margin-top: -20px;
        margin-bottom: 35px;
        padding: 24px 20px;
        border-radius: 16px;
    }

    .course-progress-box h2 {
        font-size: 25px;
    }

    #progress-text {
        font-size: 14px;
    }

    #course-percentage {
        font-size: 17px;
    }

    main {
        width: 94%;
        margin-bottom: 55px;
    }

    main > section {
        margin-bottom: 20px;
        padding: 25px 18px;
        border-radius: 16px;
    }

    main > section > h2 {
        font-size: 26px;
    }

    main > section > p,
    .lesson p {
        font-size: 15px;
        line-height: 1.75;
    }

    .lesson h2 {
        font-size: 24px;
    }

    .lesson h3 {
        font-size: 18px;
    }

    pre {
        margin: 20px 0;
        padding: 17px;
        border-radius: 10px;
        font-size: 12px;
        line-height: 1.65;
    }

    .lesson ul,
    .lesson ol,
    main > section:last-of-type ul {
        padding-left: 21px;
    }

    .lesson li,
    main > section:last-of-type li {
        font-size: 14px;
    }

    .lesson > a {
        justify-content: center;
        width: 100%;
        margin-top: 15px;
        margin-left: 0;
    }

    .complete-btn {
        width: 100%;
        margin-top: 20px;
    }

    .lesson table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .lesson th,
    .lesson td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .lesson form {
        width: 100%;
    }

    .lesson form input,
    .lesson form textarea,
    .lesson form select {
        font-size: 16px;
    }

    .navigation-buttons {
        gap: 12px;
    }

    .navigation-buttons a {
        min-width: 0;
    }

    footer {
        margin-top: 40px;
        padding: 30px 18px;
    }
}

@media (max-width: 400px) {
    header h1 {
        font-size: 29px;
    }

    header p {
        font-size: 14px;
    }

    .course-progress-box {
        padding: 20px 16px;
    }

    .course-progress-box h2 {
        font-size: 23px;
    }

    main > section {
        padding: 22px 15px;
    }

    main > section > h2 {
        font-size: 23px;
    }

    .lesson h2 {
        font-size: 22px;
    }

    pre {
        padding: 14px;
        font-size: 11px;
    }

    #progress-text {
        font-size: 12px;
    }
}