:root {
    /* Color Palette */
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary: #0EA5E9; /* Light Blue */
    --background: #F8FAFC; /* Slate 50 */
    --surface: #FFFFFF;
    --text-main: #0F172A; /* Slate 900 */
    --text-muted: #64748B; /* Slate 500 */
    --success: #10B981; /* Emerald */
    --error: #EF4444; /* Red */
    --border: #E2E8F0; /* Slate 200 */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Radius */
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background-color: var(--surface);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs span {
    cursor: pointer;
    transition: color 0.2s;
}

.breadcrumbs span:hover {
    color: var(--primary);
}

/* Main Container */
.app-container {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Cards Grid */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card i {
    font-size: 3rem;
    color: var(--primary);
}

.card h3 {
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Topic List */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-item {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid var(--primary);
}

.topic-item:hover {
    background: var(--background);
    transform: translateX(5px);
}

/* Practice View */
.practice-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    position: relative;
}

.practice-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.practice-header h2 {
    font-size: 1.8rem;
    color: var(--text-main);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

.btn-secondary:hover {
    background: var(--background);
}

/* Question Styles */
.question-block {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #FAFAFA;
}

.question-text {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Radio Buttons */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.option-label:hover {
    border-color: var(--primary);
    background: #F5F3FF;
}

.option-label input[type="radio"] {
    accent-color: var(--primary);
    width: 1.2rem;
    height: 1.2rem;
}

/* Dropdowns */
select.modern-select {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    min-width: 150px;
}

select.modern-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Drag & Drop */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: var(--radius-md);
    min-height: 80px;
}

.chip {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 999px;
    font-weight: 500;
    cursor: grab;
    user-select: none;
    display: inline-block;
}

.chip:active {
    cursor: grabbing;
}

.drop-zone {
    display: inline-block;
    min-width: 100px;
    min-height: 35px;
    border-bottom: 2px dashed var(--primary);
    margin: 0 0.5rem;
    vertical-align: middle;
    text-align: center;
    padding: 0.2rem 0.5rem;
}

.drop-zone.filled {
    border-bottom: 2px solid var(--primary);
}

.drop-zone .chip {
    margin: 0;
}

/* Sortable List */
.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sortable-item {
    padding: 1.2rem 1.5rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.sortable-item:hover {
    box-shadow: var(--shadow-md);
}

.sortable-item:active {
    cursor: grabbing;
}

.sortable-item i {
    color: var(--text-muted);
    cursor: grab;
}

/* Action Area */
.action-area {
    margin-top: 3rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Hint System */
.hint-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #F59E0B; /* Amber */
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: transform 0.2s, background 0.2s;
}

.hint-btn:hover {
    transform: scale(1.05);
    background: #D97706;
}

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

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    transition: transform 0.3s;
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #F59E0B;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--error);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.global-notes {
    background: #FEF3C7;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid #F59E0B;
}

.topic-hints h3 {
    margin-bottom: 1rem;
}

.topic-hints ul {
    list-style-type: none;
    padding-left: 0;
}

.topic-hints li {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Validation Styles */
.correct {
    border-color: var(--success) !important;
    background-color: #ECFDF5 !important;
}

.incorrect {
    border-color: var(--error) !important;
    background-color: #FEF2F2 !important;
}

.result-icon {
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

.result-icon.fa-check {
    color: var(--success);
}

.result-icon.fa-times {
    color: var(--error);
}

/* Missed = correct answer user didn't select */
.option-label.missed {
    border-color: #F59E0B !important;
    background-color: #FFFBEB !important;
}

/* Checkbox style */
.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1.2rem;
    height: 1.2rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mock Test Card */
.card-mock {
    border: 2px solid #F59E0B;
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
}
.card-mock i { color: #F59E0B; }
.card-mock:hover { border-color: #D97706; }

/* Mock Test Header */
.mock-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.mock-progress-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}
.mock-phase-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}
.badge-reading { background: #EEF2FF; color: #4F46E5; }
.badge-listening { background: #ECFDF5; color: #10B981; }

/* Progress Bar */
.mock-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.mock-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.4s ease;
}
.mock-topic-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

/* Results */
.results-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}
.results-container h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.score-card {
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    border: 2px solid var(--border);
}
.score-card.total {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-color: var(--primary);
}
.score-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.score-value span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}
.score-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Review Area */
.review-area { margin-top: 1rem; }
.review-area h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.review-section {
    margin-bottom: 2rem;
}
.review-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: #EEF2FF;
    border-radius: var(--radius-md);
}
.review-item {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    background: #FAFAFA;
    font-size: 0.9rem;
}
.review-question { font-weight: 600; margin-bottom: 0.4rem; }
.review-user { color: var(--text-muted); }
.review-correct { color: var(--success); font-weight: 600; margin-top: 0.2rem; }
.wrong-ans { color: var(--error); font-weight: 600; }
.right-ans { color: var(--success); font-weight: 600; }
.all-correct {
    text-align: center;
    font-size: 1.2rem;
    padding: 2rem;
    color: var(--success);
}
.results-action-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    .practice-container {
        padding: 1.5rem;
    }
}
