/* ========== ROOT ========== */
:root {
    --primary-color: #004a7f;
    --primary-color-dark: #00365c;
    --secondary-color: #4a6588;
    --text-color: #0d2c4f;
    --bg-color-start: #fdeef4;
    --bg-color-end: #e8f5f7;
    --white-color: #ffffff;
    --light-gray-color: #f0f0f0;
    --dark-gray-color: #333333;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Nunito', sans-serif;
    --soft-shadow: 0 12px 35px -10px rgba(0, 74, 127, .15);
    --soft-shadow-hover: 0 16px 45px -12px rgba(0, 74, 127, .2);
    --subtle-glow: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(0, 74, 127, .1), transparent 80%);
}

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

html {
    scroll-behavior: smooth
}

body {
    font-family: var(--font-primary);
    background-color: var(--white-color);
    color: var(--text-color)
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all .3s ease;
    border: 2px solid transparent;
    font-size: 15px;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 74, 127, .2);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 74, 127, .3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color)
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 74, 127, .05);
    transform: translateY(-3px)
}

/* ========== NAVBAR (partial ile aynı sınıflar kullanılıyorsa uyumlu kalsın) ========== */
.navbar {
    background: var(--white-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    position: relative;
    width: 100%;
    z-index: 1000
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px
}

.logo-img {
    height: 60px;
    width: auto
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px
}

.nav-link {
    color: var(--dark-gray-color);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    transition: color .3s ease;
    position: relative;
    padding-bottom: 5px
}

.nav-link:hover {
    color: var(--primary-color)
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width .3s ease
}

.nav-link:hover::after {
    width: 100%
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001
}

.hamburger {
    width: 100%;
    height: 3px;
    background: var(--dark-gray-color);
    transition: all .3s ease-in-out;
    border-radius: 2px
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--white-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    transform: translateY(-10px);
    opacity: 0;
    transition: transform .3s ease-out, opacity .3s ease-out;
    pointer-events: none
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto
}

.mobile-menu-content {
    padding: 20px
}

.mobile-link {
    display: block;
    padding: 15px 0;
    color: var(--dark-gray-color);
    font-weight: 500;
    font-size: 16px;
    border-bottom: 1px solid var(--light-gray-color);
    text-decoration: none;
    transition: color .3s
}

.mobile-link:hover {
    color: var(--primary-color)
}

.mobile-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.mobile-buttons .btn {
    width: 100%
}

/* ========== HEADER ========== */
.page-header--speed {
    background-image: linear-gradient(120deg, var(--bg-color-start), var(--bg-color-end));
    background-size: 100% 100%;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header--speed::before {
    content: 'T';
    font-family: var(--font-secondary);
    font-weight: 800;
    position: absolute;
    font-size: 300px;
    color: var(--text-color);
    opacity: .025;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    z-index: 1;
    user-select: none;
}

.speedtest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2
}

.page-header--speed h1 {
    font-family: var(--font-secondary);
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--text-color);
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(13, 44, 79, .05);
}

.page-header--speed p {
    color: var(--secondary-color);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: clamp(1rem, 2vw, 1.2rem)
}

/* ========== LAYOUT & CARDS ========== */
.grid {
    display: grid;
    grid-template-columns: 1.4fr .9fr;
    gap: 40px;
    margin: 60px auto
}

.card {
    background: var(--white-color);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--soft-shadow);
    position: relative;
    overflow: hidden;
    transition: box-shadow .4s ease;
}

.card:hover {
    box-shadow: var(--soft-shadow-hover)
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--subtle-glow);
    opacity: 0;
    transition: opacity .4s ease;
    z-index: 0;
    pointer-events: none
}

.card:hover::before {
    opacity: 1
}

.card>* {
    position: relative;
    z-index: 1
}

.card h3 {
    font-family: var(--font-secondary);
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.8rem
}

/* ========== CONTROLS ========== */
.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px
}

.select {
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid rgba(0, 74, 127, .1);
    background: var(--white-color);
    font: inherit;
    color: var(--text-color);
    font-weight: 500;
    min-width: 160px;
    transition: .3s ease;
}

.select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 74, 127, .1)
}

/* ========== INFO STRIP & BADGE ========== */
.info-strip {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--bg-color-start), var(--bg-color-end));
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
}

.badge {
    background: var(--white-color);
    border: 1px solid rgba(0, 74, 127, .08);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: .95rem;
    color: var(--text-color);
    min-width: 120px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 74, 127, .08);
}

.badge b {
    display: block;
    font-size: 1.4rem;
    font-family: var(--font-secondary);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 2px
}

.muted {
    color: var(--secondary-color);
    font-size: .9rem;
    font-weight: 500
}

/* ========== PASSAGE & PROGRESS ========== */
.passage {
    line-height: 1.9;
    font-size: 1.1rem;
    color: var(--dark-gray-color);
    max-height: 400px;
    overflow: auto;
    padding: 25px;
    background: #fafafa;
    border-radius: 16px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 20px;
}

.passage:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px
}

.passage mark {
    background: rgba(0, 74, 127, .1);
    border-radius: 6px;
    padding: 3px 6px;
    color: var(--primary-color);
    font-weight: 600
}

.meter {
    height: 12px;
    background: var(--light-gray-color);
    border-radius: 999px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1)
}

.meter>span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width .2s ease;
    border-radius: 999px
}

/* ========== QUIZ & SCORE ========== */
.qa-list {
    display: grid;
    gap: 20px;
    margin-top: 20px
}

.qa-item {
    border: 1px solid rgba(0, 74, 127, .1);
    border-radius: 16px;
    padding: 25px;
    background: var(--white-color);
    box-shadow: 0 4px 15px rgba(0, 74, 127, .05)
}

.qa-item h4 {
    font-size: 1.1rem;
    margin: 0 0 15px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.4
}

.qa-options {
    display: grid;
    gap: 10px
}

.qa-options label {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 15px 18px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: .3s ease;
    background: #fafafa;
}

.qa-options label:hover {
    background: rgba(0, 74, 127, .05);
    border-color: var(--primary-color)
}

.qa-options input {
    accent-color: var(--primary-color);
    transform: scale(1.2)
}

.qa-options label span {
    color: var(--text-color);
    font-weight: 500
}

.score {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px
}

.score .pill {
    background: linear-gradient(135deg, var(--bg-color-start), var(--bg-color-end));
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 74, 127, .08);
}

.score .pill b {
    display: block;
    font-size: 2rem;
    color: var(--primary-color);
    font-family: var(--font-secondary);
    font-weight: 800;
    margin: 8px 0
}

/* ========== ASIDE ========== */
.aside .best {
    background: var(--white-color);
    border: 1px solid rgba(0, 74, 127, .08);
    border-radius: 16px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 74, 127, .05);
}

.aside .best .muted {
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600
}

.aside .tips {
    margin-top: 25px;
    background: #f7f9fc;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(0, 74, 127, .08)
}

.tips b {
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: var(--font-secondary);
    font-weight: 700;
    display: block;
    margin-bottom: 12px
}

.tips ul {
    margin: 15px 0 0 20px;
    line-height: 1.8;
    color: var(--secondary-color)
}

.tips li {
    margin-bottom: 8px;
    font-weight: 500
}

/* ========== RESPONSIVE ========== */
@media (max-width:968px) {

    .nav-menu,
    .nav-buttons {
        display: none
    }

    .mobile-toggle {
        display: flex
    }

    .mobile-menu {
        display: block
    }
}

@media (max-width:768px) {
    .nav-container {
        height: 70px
    }

    .logo-img {
        height: 50px
    }

    .mobile-menu {
        top: 70px
    }

    .page-header--speed {
        padding: 100px 0 60px
    }

    .speedtest-container {
        padding: 0 15px
    }

    .card {
        padding: 25px 20px
    }

    .toolbar {
        flex-direction: column;
        gap: 10px
    }

    .toolbar .btn,
    .select {
        width: 100%
    }

    .info-strip {
        flex-direction: column;
        gap: 10px
    }

    .score {
        grid-template-columns: 1fr
    }
}

@media (max-width:480px) {
    .nav-container {
        height: 65px;
        padding: 0 15px
    }

    .logo-img {
        height: 45px
    }

    .mobile-menu {
        top: 65px
    }

    .page-header--speed {
        padding: 80px 0 40px
    }

    .grid {
        margin: 40px auto
    }

    .passage {
        padding: 20px;
        font-size: 1rem
    }

    .btn {
        padding: 10px 22px;
        font-size: 14px
    }
}

/* ========== EKSİK RESPONSİVE DÜZENLEMELER ========== */

/* Grid layout - tablet için */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin: 40px auto;
    }
}

/* Toolbar - tablet ve mobil için */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .toolbar .btn,
    .select {
        width: 100%;
    }

    .info-strip {
        flex-direction: column;
        gap: 10px;
    }

    .score {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Mobil için ekstra düzenlemeler */
@media (max-width: 480px) {
    .speedtest-container {
        padding: 0 15px;
    }

    .card {
        padding: 20px 15px;
    }

    .passage {
        padding: 15px;
        font-size: 1rem;
        max-height: 300px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .page-header--speed {
        padding: 80px 0 40px;
    }

    .qa-options label {
        padding: 12px 15px;
    }

    .badge {
        min-width: auto;
        padding: 12px 15px;
    }

    .badge b {
        font-size: 1.2rem;
    }
}

/* Çok küçük ekranlar için */
@media (max-width: 320px) {
    .card {
        padding: 15px 10px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .passage {
        padding: 12px;
        font-size: 0.95rem;
    }
}