/* =====================================================
   UI ONLINE TYPING TEST
   MODERN MULTI PAGE DESIGN
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --secondary: #06b6d4;
    --dark: #172033;
    --text: #334155;
    --light: #f5f7fb;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
}


/* =====================================================
   BODY
   ===================================================== */

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--light);
    color: var(--text);
    min-height: 100vh;
}


/* =====================================================
   HEADER
   ===================================================== */

.top-header {
    height: 74px;

    background: var(--white);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 35px;

    border-bottom: 1px solid var(--border);

    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);

    position: sticky;
    top: 0;
    z-index: 1000;
}


/* =====================================================
   LOGO
   ===================================================== */

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-circle {
    width: 50px;
    height: 50px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--secondary)
        );

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 21px;
    font-weight: 900;

    box-shadow:
        0 5px 15px rgba(79, 70, 229, 0.3);
}

.logo-text {
    font-size: 23px;
    font-weight: 700;
    color: var(--dark);
}

.logo-text span {
    color: var(--primary);
}


/* =====================================================
   NAVIGATION
   ===================================================== */

.navigation {
    display: flex;
    align-items: center;
    height: 100%;
}

.navigation a {
    height: 100%;

    display: flex;
    align-items: center;

    padding: 0 16px;

    text-decoration: none;

    color: #475569;

    font-size: 15px;
    font-weight: 600;

    transition: 0.25s;
}

.navigation a:hover {
    color: var(--primary);
    background: #f1f5ff;
}

.navigation a.active {
    color: var(--primary);

    background: #eef2ff;

    border-bottom: 3px solid var(--primary);
}


/* =====================================================
   MENU BUTTON
   ===================================================== */

.menu-btn {
    display: none;

    border: none;
    background: transparent;

    font-size: 28px;

    cursor: pointer;

    color: var(--dark);
}


/* =====================================================
   MOBILE MENU
   ===================================================== */

.mobile-menu {
    display: none;

    background: white;

    border-bottom: 1px solid var(--border);

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);

    position: sticky;
    top: 74px;

    z-index: 999;
}

.mobile-menu a {
    display: block;

    padding: 15px 25px;

    text-decoration: none;

    color: var(--dark);

    border-bottom: 1px solid var(--border);

    font-weight: 600;
}

.mobile-menu a:hover {
    background: #eef2ff;
    color: var(--primary);
}


/* =====================================================
   MAIN CONTAINER
   ===================================================== */

.main-container {
    width: 94%;
    max-width: 1200px;

    margin: 35px auto 60px;
}


/* =====================================================
   LOGIN NOTICE
   ===================================================== */

.login-notice {
    width: fit-content;

    max-width: 90%;

    margin: 0 auto 25px;

    padding: 12px 22px;

    background: #eef2ff;

    border: 1px solid #c7d2fe;

    border-radius: 30px;

    color: #475569;

    text-align: center;

    font-size: 15px;
}

.login-notice strong {
    color: var(--primary);
}

.login-notice span {
    margin: 0 5px;
}


/* =====================================================
   TYPING TEST SECTION
   ===================================================== */

.typing-test-section {
    width: 100%;
}

.section-heading {
    text-align: center;

    margin-bottom: 25px;
}

.section-heading h1 {
    font-size: 34px;

    color: var(--dark);

    margin-bottom: 8px;
}

.section-heading p {
    color: #64748b;

    font-size: 16px;
}


/* =====================================================
   TIME SELECTOR
   ===================================================== */

.time-selector {
    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 18px 20px;

    margin-bottom: 20px;

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.05);
}

.time-title {
    text-align: center;

    font-weight: 700;

    color: var(--dark);

    margin-bottom: 14px;
}

.time-options {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;
}

.time-btn {
    border: 1px solid #cbd5e1;

    background: white;

    color: #475569;

    padding: 9px 18px;

    border-radius: 8px;

    cursor: pointer;

    font-weight: 600;

    transition: 0.2s;
}

.time-btn:hover {
    border-color: var(--primary);

    color: var(--primary);
}

.time-btn.selected {
    background: var(--primary);

    color: white;

    border-color: var(--primary);
}


/* =====================================================
   TYPING CARD
   ===================================================== */

.typing-card {
    background:
        linear-gradient(
            145deg,
            #172033,
            #202b45
        );

    border-radius: 22px;

    padding: 28px;

    box-shadow:
        0 15px 35px rgba(15, 23, 42, 0.22);
}


/* =====================================================
   STATISTICS
   ===================================================== */

.statistics {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    text-align: center;

    color: white;

    margin-bottom: 22px;
}

.stat {
    position: relative;
}

.stat-label {
    color: #cbd5e1;

    font-size: 14px;

    margin-bottom: 5px;

    font-weight: 600;
}

.stat-value {
    font-size: 36px;

    font-weight: 800;

    color: white;
}

.stat-small {
    color: #94a3b8;

    font-size: 12px;
}


/* =====================================================
   TYPING TEXT
   ===================================================== */

.typing-text-box {
    background: white;

    border-radius: 12px;

    padding: 22px;

    min-height: 190px;

    border: 3px solid #c7d2fe;

    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.04);

    overflow: hidden;
}

#typing-text {
    font-family:
        "Courier New",
        monospace;

    font-size: 22px;

    line-height: 1.8;

    font-weight: 600;

    color: #94a3b8;

    word-spacing: 3px;
}


/* =====================================================
   CHARACTER COLORS
   ===================================================== */

.typing-character.correct {
    color: var(--success);
}

.typing-character.wrong {
    color: var(--danger);

    background: #fee2e2;
}

.typing-character.current {
    background: #fef3c7;

    color: #92400e;

    border-radius: 2px;
}


/* =====================================================
   INPUT
   ===================================================== */

#typing-input {
    width: 100%;

    height: 100px;

    margin-top: 15px;

    padding: 15px;

    border: 2px solid #cbd5e1;

    border-radius: 10px;

    resize: none;

    font-family:
        "Courier New",
        monospace;

    font-size: 18px;

    outline: none;

    display: block;

    color: #1e293b;

    background: white;

    transition: 0.2s;
}

#typing-input:focus {
    border-color: var(--secondary);

    box-shadow:
        0 0 0 3px rgba(6, 182, 212, 0.15);
}

#typing-input:disabled {
    background: #e2e8f0;

    cursor: not-allowed;
}


/* =====================================================
   BUTTONS
   ===================================================== */

.typing-buttons {
    display: flex;

    justify-content: center;

    gap: 15px;

    margin-top: 18px;
}

.typing-buttons button {
    padding: 10px 24px;

    border-radius: 8px;

    border: none;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}

.typing-buttons button:hover {
    transform: translateY(-2px);
}

.reset-button {
    background: #f59e0b;

    color: #111827;
}

.switch-button {
    background: var(--secondary);

    color: white;
}


/* =====================================================
   RESULT BOX
   ===================================================== */

.result-box {
    display: none;

    background: white;

    margin-top: 25px;

    padding: 25px;

    border-radius: 15px;

    border: 1px solid var(--border);

    box-shadow:
        0 5px 20px rgba(0, 0, 0, 0.07);
}

.result-box.show {
    display: block;
}

.result-box h2 {
    text-align: center;

    color: var(--dark);

    margin-bottom: 20px;
}

.result-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 15px;
}

.result-grid div {
    text-align: center;

    background: #f8fafc;

    border-radius: 10px;

    padding: 15px;
}

.result-grid span {
    display: block;

    color: #64748b;

    font-size: 13px;

    margin-bottom: 7px;
}

.result-grid strong {
    display: block;

    color: var(--primary);

    font-size: 21px;
}


/* =====================================================
   FOOTER
   ===================================================== */

.footer {
    background: var(--dark);

    color: #cbd5e1;

    text-align: center;

    padding: 28px;

    line-height: 1.9;
}

.footer strong {
    color: white;
}

.footer a {
    color: #67e8f9;

    text-decoration: none;

    font-weight: 600;
}

.copyright {
    margin-top: 7px;

    font-size: 13px;

    color: #94a3b8;
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {

    .top-header {
        padding: 0 20px;
    }

    .navigation a {
        padding: 0 9px;
        font-size: 13px;
    }

    .logo-text {
        font-size: 19px;
    }

    .result-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


@media (max-width: 700px) {

    .top-header {
        height: 68px;
    }

    .navigation a {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .mobile-menu {
        top: 68px;
    }

    .mobile-menu.show {
        display: block;
    }

    .main-container {
        width: 94%;
        margin-top: 25px;
    }

    .section-heading h1 {
        font-size: 27px;
    }

    .typing-card {
        padding: 18px;
        border-radius: 15px;
    }

    .statistics {
        gap: 5px;
    }

    .stat-value {
        font-size: 28px;
    }

    #typing-text {
        font-size: 18px;
        line-height: 1.7;
    }

    .typing-text-box {
        padding: 15px;
    }

}


@media (max-width: 480px) {

    .logo-circle {
        width: 42px;
        height: 42px;

        border-radius: 11px;

        font-size: 17px;
    }

    .logo-text {
        font-size: 16px;
    }

    .login-notice {
        font-size: 13px;
        padding: 10px 14px;
    }

    .statistics {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-value {
        font-size: 25px;
    }

    .time-options {
        gap: 7px;
    }

    .time-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .typing-buttons {
        flex-direction: column;
    }

    .typing-buttons button {
        width: 100%;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    #typing-input {
        height: 90px;
        font-size: 16px;
    }

}