/* Modern Renk Paleti */
:root {
    --primary: #6366f1; /* Yumuşak mor */
    --secondary: #a5b4fc; /* Açık mor */
    --accent: #22d3ee; /* Canlı turkuaz */
    --text-light: #f9fafb;
    --text-dark: #1e293b;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-light: #ffffff;
    --card-dark: #1e293b;
    --success: #34d399;
    --warning: #facc15;
    --error: #f87171;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

/* Tema Değişkenleri */
[data-theme="dark"] {
    --text-primary: var(--text-light);
    --text-secondary: #d1d5db;
    --bg-primary: var(--bg-dark);
    --bg-secondary: #1e293b;
    --card-bg: var(--card-dark);
}

[data-theme="light"] {
    --text-primary: var(--text-dark);
    --text-secondary: #64748b;
    --bg-primary: var(--bg-light);
    --bg-secondary: #ffffff;
    --card-bg: var(--card-light);
}

/* Genel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.6rem; /* Yazı boyutunu biraz küçülttük */
    font-weight: 800; /* Yazıyı incelttik */
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); /* Hafif bir gölge efekti */
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto; /* Üstten boşluk kaldırıldı */
    padding: 0 1.5rem;
    padding-bottom: 4rem; /* Footer yüksekliği kadar boşluk bırak */
    flex: 1; /* Container'ın tüm boş alanı kaplamasını sağlar */
    display: flex; /* Flex düzeni ekle */
    justify-content: center; /* Yatayda ortala */
    align-items: center; /* Dikeyde ortala */
    min-height: calc(100vh - 60px); /* Header ve footer yüksekliğini çıkararak tam ekran yüksekliği */
}

/* Skill Cards */
.skill-cards {
    display: flex; /* Grid yerine flex kullanarak yan yana sıralama */
    flex-wrap: nowrap; /* Kartların alt satıra geçmesini engelle */
    gap: 2rem; /* Kartlar arasındaki boşluk */
    justify-content: center; /* Yatayda ortala */
    align-items: center; /* Dikeyde ortala */
}

.skill-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
}

.typing-card::before {
    background: linear-gradient(to right, #6366f1, #a5b4fc);
}

.reading-card::before {
    background: linear-gradient(to right, #22d3ee, #06b6d4);
}

.math-card::before {
    background: linear-gradient(to right, #34d399, #10b981);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.skill-card h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.skill-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Butonlar */
.skill-btn {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.skill-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.retry-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.retry-btn {
    width: 100%;
    text-align: center;
}

.difficulty-buttons,
.speed-buttons,
.theme-buttons,
.time-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.difficulty-btn,
.speed-btn,
.theme-btn {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover,
.speed-btn:hover,
.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    padding: 2rem;
    position: relative;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.practice-area {
    margin-top: 2rem;
}

.typing-test {
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    background-color: var(--bg-secondary);
}

.sample-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 4rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

[data-theme="dark"] .sample-text {
    color: var(--text-light); /* Koyu modda kelimeler beyaz olacak */
}

.word {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

[data-theme="dark"] .word {
    color: var(--text-light); /* Koyu modda kelimeler beyaz olacak */
}

.word.active {
    background-color: #d1d5db;
}

[data-theme="dark"] .word.active {
    background-color: #64748b; /* Koyu modda aktif kelime için daha koyu bir gri */
    color: var(--text-light);
}

.word.correct {
    background-color: var(--success);
    color: white;
}

.word.wrong {
    background-color: var(--error);
    color: white;
}

.typing-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary);
}

.typing-input.correct {
    border-color: var(--success);
}

.typing-input.wrong {
    border-color: var(--error);
}

.reading-test {
    text-align: center;
}

.reading-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 2rem 0;
    text-align: left;
    color: var(--text-primary);
    max-height: 300px;
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    background-color: var(--bg-secondary);
}

.reading-text .word {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    margin: 0 0.1rem;
}

.reading-text .word.active {
    background-color: #d1d5db;
}

.math-test {
    text-align: center;
}

.math-problem {
    font-size: 2.5rem;
    margin: 2rem 0;
    font-weight: 500;
}

.timer {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

select {
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    text-align: center;
    width: 30%;
    min-width: 160px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary);
}

.wrong-words {
    margin-top: 1.5rem;
    text-align: center;
}

.wrong-words h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.wrong-words ul {
    list-style: none;
    padding: 0;
    max-height: 120px;
    overflow-y: auto;
    color: var(--error);
    font-size: 1rem;
}

.wrong-words li {
    margin: 0.3rem 0;
}

.success-message {
    margin-top: 1.5rem;
    text-align: center;
}

.success-message h3 {
    font-size: 1.6rem;
    color: var(--success);
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 0.3rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .nav.active {
        display: flex;
    }

    .container {
        min-height: calc(100vh - 50px); /* Mobil cihazlarda header/footer yüksekliği daha küçük olabilir */
        padding: 0 1rem;
    }

    .skill-cards {
        flex-direction: column; /* Mobil cihazlarda kartlar alt alta dizilsin */
        gap: 1.5rem;
        justify-content: center; /* Yatayda ortala (column olduğu için bu x ekseninde etkili değil) */
        align-items: center; /* Dikeyde ortala (column olduğu için bu y ekseninde etkili) */
    }

    .skill-card {
        padding: 1.5rem;
    }

    .skill-icon {
        font-size: 2.5rem;
    }

    .skill-card h3 {
        font-size: 1.4rem;
    }

    .skill-card p {
        font-size: 0.9rem;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 1.5rem;
    }

    .close-modal {
        font-size: 1.5rem;
    }

    .retry-buttons,
    .difficulty-buttons,
    .speed-buttons,
    .theme-buttons,
    .time-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .stat-card {
        width: 100%;
    }

    .math-problem {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .theme-toggle {
        font-size: 1.1rem;
    }

    .skill-card {
        padding: 1.2rem;
    }

    .skill-icon {
        font-size: 2rem;
    }

    .skill-card h3 {
        font-size: 1.2rem;
    }

    .skill-btn {
        padding: 0.7rem 1.2rem;
    }

    .modal-content {
        padding: 1rem;
    }

    .timer {
        font-size: 1.4rem;
    }

    .typing-input {
        font-size: 1rem;
        padding: 0.8rem;
    }

    .math-problem {
        font-size: 1.8rem;
    }
}