/* * ==================== BASE LAYOUT OVERRIDES (Full Width Adjustment) ====================
 */

.practice-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ==================== Filter Section ==================== */
.filter-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

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

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #fff5f5;
    border: 2px solid #f1b0b7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-option:hover {
    background: #ffe5e5;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(198, 19, 34, 0.15);
}

.filter-option.active {
    background: #c61322;
    color: white;
    border-color: #c61322;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c61322;
    flex-shrink: 0;
}

.filter-option label {
    cursor: pointer;
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
}

.count-badge {
    background: #c61322;
    color: white;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.filter-option.active .count-badge {
    background: white;
    color: #c61322;
}

/* ==================== Settings Row ==================== */
.settings-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid #e8e8e8;
}

.setting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.setting label {
    font-weight: 500;
    color: #555;
    cursor: pointer;
}

.setting input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #c61322;
}

.setting select {
    padding: 7px 12px;
    border: 2px solid #c61322;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
}

.setting select:hover,
.setting select:focus {
    border-color: #ff4757;
    box-shadow: 0 0 0 3px rgba(198, 19, 34, 0.1);
    outline: none;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 11px 24px;
    background: #c61322;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: #ff4757;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 19, 34, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ==================== Progress Bar ==================== */
.progress-bar {
    height: 8px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c61322 0%, #ff4757 100%);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

/* ==================== Exercise Card ==================== */
.exercise-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Question Elements ==================== */
.question-number {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.topic-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    color: #c61322;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #f1b0b7;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.question-text {
    font-size: 1.5rem;
    color: #222;
    margin-bottom: 28px;
    font-weight: 500;
    line-height: 1.7;
    max-width: 600px;
}

/* ==================== Input Fields ==================== */

.answer-input {
    padding: 14px 18px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 24px;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    box-sizing: border-box;
}

.answer-input:focus {
    outline: none;
    border-color: #c61322;
    box-shadow: 0 0 0 4px rgba(198, 19, 34, 0.1);
}

.answer-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.answer-input::placeholder {
    color: #aaa;
    font-weight: 400;
}

/* ==================== Exercise Card Buttons ==================== */
#exerciseCard .btn {
    margin-top: 8px;
    min-width: 160px;
}

/* ==================== Result Messages ==================== */
.result-message {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 20px 0;
    padding: 14px 20px;
    border-radius: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* ==================== Score & Timer Display ==================== */
.score-display {
    font-size: 1.05rem;
    color: #666;
    margin-top: 18px;
    font-weight: 600;
}

.timer-display {
    font-size: 1.15rem;
    color: #c61322;
    font-weight: 700;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

.final-score {
    font-size: 2.5rem;
    color: #c61322;
    margin: 25px 0;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ==================== States ==================== */
.empty-state {
    text-align: center;
    color: #999;
    padding: 50px 30px;
    font-size: 1.15rem;
    line-height: 1.8;
}

.empty-state p {
    margin: 0;
}

.loading-state {
    text-align: center;
    color: #c61322;
    padding: 50px 30px;
    font-size: 1.25rem;
    font-weight: 600;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #f5c6cb;
    line-height: 1.7;
}

.error-message p {
    margin: 8px 0;
}

.error-message strong {
    font-weight: 700;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .practice-container {
        padding: 0 18px;
        /* Consistent left/right padding */
        margin-top: 10px;
        margin-bottom: 25px;
    }

    /* FIX: Apply consistent padding to header if it's full-width */
    header {
        padding: 30px 18px 15px;
        /* Using 18px for consistency */
    }

    header h1 {
        font-size: 1.9rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }

    /* FIX: Remove conflicting margin, let container/header padding handle spacing */
    header p {
        font-size: 1rem;
        color: #666;
        margin: 0;
        /* Changed from 0 10px to 0 */
    }

    .filter-section {
        padding: 20px;
        margin-bottom: 22px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .filter-option {
        padding: 12px 15px;
        border-radius: 10px;
    }

    .settings-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding-top: 15px;
    }

    .btn {
        width: 100%;
        padding: 12px 0;
        border-radius: 10px;
    }

    .exercise-card {
        padding: 28px 18px;
        margin: 0 0 20px 0;
        border-radius: 12px;
        min-height: 300px;
    }

    .question-text {
        font-size: 1.25rem;
        margin-bottom: 22px;
        line-height: 1.5;
    }

    .answer-input {
        max-width: 100%;
        font-size: 1rem;
        margin-bottom: 20px;
        padding: 12px 16px;
    }

    .final-score {
        font-size: 2rem;
        margin: 25px 0;
    }

    /* FIX: Apply consistent padding to footer if it's full-width */
    footer {
        margin-top: 30px;
        padding: 15px 18px;
        /* Using 18px for consistency */
    }
}

@media (max-width: 480px) {
    .practice-container {
        padding: 0 14px;
        /* Consistent left/right padding */
        margin-top: 8px;
        margin-bottom: 20px;
    }

    /* FIX: Update header padding to the new 14px value */
    header {
        padding: 25px 14px 12px;
    }

    header h1 {
        font-size: 1.7rem;
    }

    .filter-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .filter-option {
        padding: 10px 12px;
    }

    .filter-option label {
        font-size: 0.9rem;
    }

    .exercise-card {
        padding: 25px 16px;
        margin-bottom: 20px;
    }

    .question-text {
        font-size: 1.15rem;
        margin-bottom: 18px;
    }

    .answer-input {
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 11px 0;
        margin-top: 10px;
    }

    .result-message {
        font-size: 0.95rem;
        padding: 10px 14px;
        margin: 16px 0;
    }

    .final-score {
        font-size: 1.7rem;
    }

    /* FIX: Update footer padding to the new 14px value */
    footer {
        font-size: 0.85rem;
        padding: 15px 14px;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    body {
        background: white;
    }

    .filter-section,
    .btn,
    footer {
        display: none;
    }

    .exercise-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}