/* Maths Test Styles - Isolated */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #0f172a;
    overflow-x: hidden;
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-logo img { width: 40px; height: 40px; margin-right: 12px; }

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

.subject-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.subject-btn:hover { background: rgba(255, 255, 255, 0.1); }
.subject-btn.active { background: #3b82f6; border-color: #3b82f6; }

/* Main Content */
.child-test-main {
    padding: 24px 0;
    min-height: calc(100vh - 70px);
}

/* Test Setup Panel */
.test-setup { max-width: 900px; margin: 0 auto; }

.practice-panel {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
}

.practice-header {
    text-align: center;
    margin-bottom: 32px;
}

.practice-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.practice-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.practice-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* Practice Cards */
.practice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.practice-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-icon { font-size: 32px; margin-bottom: 12px; }

.practice-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.practice-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.card-timer-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: #3b82f6; color: #ffffff; }
.btn-primary:hover { background: #2563eb; }

.btn-success { background: #22c55e; color: #ffffff; }
.btn-success:hover { background: #16a34a; }

.btn-info { background: #06b6d4; color: #ffffff; }
.btn-info:hover { background: #0891b2; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

/* Loading Screen */
.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loading-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-progress { margin-top: 24px; }

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Test Questions */
.test-questions { max-width: 900px; margin: 0 auto; }

.test-progress {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-counter {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.section-timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 8px;
}

.section-timer-title { font-weight: 500; color: #ffffff; }
.section-timer-time {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: #22c55e;
}

/* Question Card */
.question-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
}

.question-content { margin-bottom: 24px; }

.question-content h3 {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    color: #ffffff;
}

/* Visual Container - Key for Maths */
.visual-element {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 24px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    color: #111827;
}

.visual-element svg {
    max-width: 100%;
    height: auto;
}

.visual-element table {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    border-collapse: collapse;
}

.visual-element th,
.visual-element td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.visual-element th {
    background: #f1f5f9;
    font-weight: 600;
}

/* Answer Options */
.answer-options { margin-bottom: 24px; }

.answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.answer-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
}

.answer-option label {
    flex: 1;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
}

/* Text Input */
.answer-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.answer-input input[type="text"] {
    flex: 1;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
}

.answer-input input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.currency-prefix {
    font-size: 1.25rem;
    font-weight: 600;
    color: #22c55e;
}

/* Question Actions */
.question-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Feedback */
.answer-feedback { margin-top: 20px; }

.feedback {
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

.feedback.correct {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.feedback.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* Results Screen */
.results-screen { max-width: 600px; margin: 0 auto; }

.setup-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
}

.setup-icon { font-size: 48px; margin-bottom: 16px; }

.setup-card h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.score-display { margin: 32px 0; }

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.score-circle span {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.results-feedback {
    text-align: left;
    margin: 24px 0;
}

.results-feedback h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.results-feedback ul {
    list-style: none;
    padding: 0;
}

.results-feedback li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

/* Paper Test Screen */
#paperTestScreen {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container { padding: 0 16px; }
    .nav-menu { display: none; }
    .practice-panel { padding: 24px; }
    .practice-options { grid-template-columns: 1fr; }
    .question-card { padding: 24px; }
    .card-timer-buttons { flex-direction: column; }
    .card-timer-buttons .btn { width: 100%; }
}
