/* ConjugoThT CE2 - Styles */

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

:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --error-color: #E74C3C;
    --warning-color: #F39C12;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-color: #2C3E50;
    --border-color: #E0E6ED;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    padding: 20px;
}

body.opendyslexic {
    font-family: 'OpenDyslexic', Arial, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
}

.logo span {
    color: var(--secondary-color);
}

.options {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-option {
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.main-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    min-height: 500px;
}

.page-title {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.page-subtitle {
    text-align: center;
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--text-color);
}

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

.selection-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.selection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.selection-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.selection-card p {
    font-size: 14px;
    opacity: 0.9;
}

.selection-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.selection-card.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.selection-card.purple {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--border-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--primary-color);
    color: white;
}

.exercise-container {
    margin-top: 30px;
}

.question-box {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.question-text {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 500;
}

.question-instruction {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-align: center;
}

.option-btn:hover:not(.correct):not(.incorrect):not(:disabled) {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.option-btn.correct {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: white;
}

.option-btn.incorrect {
    border-color: var(--error-color);
    background: var(--error-color);
    color: white;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.input-answer {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 18px;
    margin-top: 15px;
}

.input-answer:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.submit-btn:hover:not(:disabled) {
    background: #3a7bc8;
    transform: scale(1.05);
}

.submit-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: scale(1);
}

.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.feedback.show {
    display: block;
    animation: fadeIn 0.3s;
}

.feedback.correct {
    background: #d4edda;
    border-left: 4px solid var(--secondary-color);
    color: #155724;
}

.feedback.incorrect {
    background: #f8d7da;
    border-left: 4px solid var(--error-color);
    color: #721c24;
}

.feedback-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.lesson-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--warning-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.lesson-btn:hover {
    background: #e67e22;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transition: width 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    min-width: 120px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 5px;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.close-modal {
    padding: 10px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
}

.conjugation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.conjugation-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.conjugation-table td:first-child {
    font-weight: bold;
    background: var(--bg-color);
    width: 30%;
}

.conjugation-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.conjugation-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.conjugation-input-row label {
    min-width: 100px;
    font-weight: bold;
}

.conjugation-input-row input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.conjugation-input-row input.correct {
    border-color: var(--secondary-color);
    background: #d4edda;
}

.conjugation-input-row input.incorrect {
    border-color: var(--error-color);
    background: #f8d7da;
}

.results-card {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.results-card h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.results-card.success h2 {
    color: var(--secondary-color);
}

.results-card.failure h2 {
    color: var(--error-color);
}

.results-score {
    font-size: 72px;
    font-weight: bold;
    margin: 30px 0;
}

.results-score.success {
    color: var(--secondary-color);
}

.results-score.failure {
    color: var(--error-color);
}

.results-message {
    font-size: 20px;
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.secondary {
    background: var(--secondary-color);
    color: white;
}

.action-btn:hover {
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.dashboard-table th,
.dashboard-table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 14px;
}

.dashboard-table th {
    background: var(--primary-color);
    color: white;
}

.dashboard-table tr:nth-child(even) {
    background: var(--bg-color);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 15px 20px;
    }

    .main-card {
        padding: 20px;
    }

    .grid-selection {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    .results-score {
        font-size: 48px;
    }

    .conjugation-input-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .conjugation-input-row label {
        min-width: auto;
    }

    .dashboard-table {
        font-size: 12px;
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 8px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selection-card {
    animation: fadeInUp 0.5s ease-out;
}

.selection-card:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(5) { animation-delay: 0.5s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(6) { animation-delay: 0.6s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(7) { animation-delay: 0.7s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(8) { animation-delay: 0.8s; opacity: 0; animation-fill-mode: forwards; }
.selection-card:nth-child(9) { animation-delay: 0.9s; opacity: 0; animation-fill-mode: forwards; }
