/* VCE Specialist Mathematics - Practice-Specific Styles */

/* Mathematical equation display */
.eq {
    font-family: "Times New Roman", serif;
    font-style: italic;
    font-size: 1.15em;
    margin: 0.5rem 0;
}

.eq-large {
    font-size: 1.3em;
}

.eq-inline {
    display: inline;
    margin: 0 0.2em;
}

/* Mathematical input fields */
.math-input {
    font-family: "Courier New", monospace;
    background: #f8f9fa;
    border: 2px solid #1b5e20;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 1.1em;
    width: 100%;
    max-width: 200px;
    text-align: center;
}

.math-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 10px rgba(27, 94, 32, 0.2);
    background: #fff;
}

.math-input.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.math-input.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

/* Step-by-step solution display */
.step-by-step {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #1b5e20;
}

.step-by-step h3 {
    color: #1b5e20;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.step {
    margin-bottom: 25px;
    padding: 20px;
    border-left: 4px solid #2e7d32;
    background: #f3f9f3;
    border-radius: 0 10px 10px 0;
    position: relative;
}

.step:last-child {
    margin-bottom: 0;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-inst {
    font-weight: 600;
    color: #1b5e20;
    margin-bottom: 10px;
    font-size: 1.05em;
}

.step-work {
    font-family: "Times New Roman", serif;
    font-size: 1.15em;
    margin: 12px 0;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.step-result {
    font-weight: bold;
    color: #2e7d32;
    background: #e8f5e8;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 1.05em;
}

/* Multiple choice questions */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.mcq-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 18px 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-size: 1.05em;
    display: flex;
    align-items: center;
}

.mcq-option:hover {
    border-color: #1b5e20;
    background: #f3f9f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 94, 32, 0.15);
}

.mcq-option.selected {
    border-color: #2e7d32;
    background: #e8f5e8;
}

.mcq-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.mcq-option.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

.mcq-option::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.mcq-option.selected::before {
    border-color: #2e7d32;
    background: #2e7d32;
    box-shadow: inset 0 0 0 3px white;
}

.mcq-option.correct::before {
    border-color: #4caf50;
    background: #4caf50;
    box-shadow: inset 0 0 0 3px white;
}

/* Fraction display */
.frac {
    display: inline-block;
    vertical-align: middle;
    text-align: center;
    font-family: "Times New Roman", serif;
    margin: 0 4px;
}

.frac .num,
.frac .den {
    display: block;
    font-size: 1em;
    line-height: 1.2;
}

.frac .num {
    border-bottom: 2px solid #333;
    padding-bottom: 3px;
}

.frac .den {
    padding-top: 3px;
}

/* Proof step ordering */
.proof-steps {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.proof-step {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 12px 0;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
    font-size: 1.05em;
}

.proof-step:hover {
    border-color: #1b5e20;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.15);
    transform: translateY(-1px);
}

.proof-step.dragging {
    opacity: 0.8;
    transform: rotate(1deg) scale(1.02);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.proof-step.correct-position {
    border-color: #4caf50;
    background: #e8f5e9;
}

.proof-step.incorrect-position {
    border-color: #f44336;
    background: #ffebee;
}

.proof-step::before {
    content: '⋮⋮';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 1.2em;
    cursor: move;
}

/* Complex plane (Argand diagram) */
.complex-plane {
    width: 100%;
    max-width: 600px;
    height: 450px;
    border: 3px solid #1b5e20;
    border-radius: 12px;
    background: white;
    position: relative;
    margin: 25px auto;
    overflow: hidden;
}

.complex-plane svg {
    width: 100%;
    height: 100%;
}

.complex-plane .axes {
    stroke: #333;
    stroke-width: 2;
}

.complex-plane .grid {
    stroke: #e0e0e0;
    stroke-width: 1;
}

.complex-plane .complex-point {
    fill: #1b5e20;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
}

.complex-plane .complex-point:hover {
    fill: #2e7d32;
    r: 6;
}

.complex-plane .vector {
    stroke: #2e7d32;
    stroke-width: 3;
    marker-end: url(#arrowhead);
}

/* 3D Vector space visualization */
.vector-space {
    width: 100%;
    max-width: 700px;
    height: 500px;
    border: 3px solid #1b5e20;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    margin: 25px auto;
    overflow: hidden;
}

.vector-space canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    display: block;
}

.vector-space canvas:active {
    cursor: grabbing;
}

.vector-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.vector-controls button {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #1b5e20;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.vector-controls button:hover {
    background: #2e7d32;
}

/* Interactive controls */
.controls-panel {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.controls-panel h4 {
    color: #1b5e20;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 8px;
}

.slider-control {
    margin: 15px 0;
}

.slider-control label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(27, 94, 32, 0.3);
    transition: all 0.2s ease;
}

.slider-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(27, 94, 32, 0.4);
}

.slider-control .slider-value {
    display: inline-block;
    background: #e8f5e8;
    color: #1b5e20;
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Button styling for green theme */
.btn-specialist {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.05em;
    text-decoration: none;
    display: inline-block;
}

.btn-specialist:hover {
    background: linear-gradient(135deg, #0a3d10, #1b5e20);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.3);
    color: white;
    text-decoration: none;
}

.btn-specialist:active {
    transform: translateY(-1px);
}

.btn-specialist.large {
    padding: 15px 30px;
    font-size: 1.15em;
}

.btn-specialist.small {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Success and error states */
.success-message {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #1b5e20;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #4caf50;
    margin: 20px 0;
    font-weight: 500;
}

.error-message {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #f44336;
    margin: 20px 0;
    font-weight: 500;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 4px solid rgba(27, 94, 32, 0.2);
    border-radius: 50%;
    border-top-color: #1b5e20;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Practice session indicators */
.skill-progress {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1b5e20, #2e7d32);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.skill-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .step-by-step {
        padding: 20px;
        margin: 15px 0;
    }

    .step {
        padding: 15px;
        margin-bottom: 20px;
    }

    .step-num {
        width: 30px;
        height: 30px;
        font-size: 1em;
        margin-right: 12px;
    }

    .mcq-options {
        gap: 12px;
    }

    .mcq-option {
        padding: 15px 18px;
        font-size: 1em;
    }

    .complex-plane,
    .vector-space {
        max-width: 100%;
        height: 300px;
        margin: 20px auto;
    }

    .controls-panel {
        padding: 15px;
    }

    .btn-specialist {
        padding: 10px 20px;
        font-size: 1em;
    }

    .math-input {
        max-width: 150px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .step {
        flex-direction: column;
        text-align: center;
    }

    .step-num {
        margin: 0 auto 10px auto;
    }

    .mcq-option {
        padding: 12px 15px;
        font-size: 0.95em;
    }

    .complex-plane,
    .vector-space {
        height: 250px;
    }

    .vector-controls {
        position: static;
        margin-top: 15px;
    }
}

/* Accessibility improvements */
.mcq-option:focus,
.proof-step:focus,
.btn-specialist:focus {
    outline: 3px solid rgba(27, 94, 32, 0.5);
    outline-offset: 2px;
}

.math-input:focus {
    outline: 3px solid rgba(46, 125, 50, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .step {
        border-left-width: 6px;
    }

    .mcq-option {
        border-width: 3px;
    }

    .complex-plane,
    .vector-space {
        border-width: 4px;
    }

    .controls-panel {
        border-width: 3px;
    }
}

/* Print styles */
@media print {
    .complex-plane,
    .vector-space {
        border: 3px solid #000;
        background: white;
    }

    .controls-panel {
        display: none;
    }

    .btn-specialist {
        display: none;
    }

    .loading-spinner {
        display: none;
    }

    .step-by-step {
        box-shadow: none;
        border: 1px solid #000;
    }
}

.question-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(27,94,32,0.08), 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.question-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #1b5e20 0%, #43a047 100%);
}

.question-badge {
    color: #fff;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 0.3px;
}

.question-badge i {
    margin-right: 8px;
    opacity: 0.9;
}

.question-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-tip-modern {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-tip-modern:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.btn-tip-modern i {
    margin-right: 6px;
    color: #fbbf24;
}

.btn-calc-modern {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.btn-calc-modern:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.btn-calc-modern i {
    margin-right: 6px;
    color: #a5d6a7;
}

.question-card-body {
    padding: 32px;
}

.question {
    font-size: 1.5rem;
    line-height: 1.8;
    color: #1a1a2e;
    margin-bottom: 28px;
    font-weight: 500;
}

.answer-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid #c8e6c9;
}

.answer_wrapper.prob {
    flex: 1;
}

.math-preview {
    margin-top: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    border: 1px solid #66bb6a;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    transition: opacity 0.2s ease;
}

.math-preview-label {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #1b5e20;
    white-space: nowrap;
}

.math-preview-content {
    font-size: 1.5rem;
    color: #1a1a2e;
    flex: 1;
}

.math-preview-content .katex {
    font-size: 1.5em;
}

.btn-submit-modern {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(27,94,32,0.3);
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-submit-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27,94,32,0.4);
}

.btn-submit-modern:active {
    transform: translateY(0);
}

.btn-submit-modern i {
    margin-right: 8px;
}

.btn-next-modern {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(27,94,32,0.3);
}

.btn-next-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27,94,32,0.4);
}

.btn-next-modern i {
    margin-left: 8px;
}

.result-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.result-incorrect {
    border-top: 4px solid #e53935;
}

.result-icon {
    font-size: 3rem;
    color: #e53935;
    margin-bottom: 12px;
}

.result-card .help-header {
    color: #c62828;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0 0 8px 0;
}

.result-card .correct-answer-help {
    color: #666;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.result-card .answer_wrapper.correct {
    background: #e8f5e9;
    border: 2px solid #43a047;
    border-radius: 10px;
    padding: 14px 20px;
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 20px;
}

.explanation-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.review-card-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #fff;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 1.5rem;
}

.review-card-header i {
    margin-right: 8px;
}

.review-card-body {
    padding: 20px 24px;
}

.review-row {
    margin-bottom: 16px;
}

.review-row:last-child {
    margin-bottom: 0;
}

.review-row label {
    display: block;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #78909c;
    margin-bottom: 6px;
    font-weight: 700;
}

.review-row .answer_wrapper.wrong {
    background: #fce4ec;
    border: 2px solid #ef5350;
    border-radius: 10px;
    padding: 10px 16px;
    color: #c62828;
    font-weight: 600;
}

.solution-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.solution-card-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    color: #fff;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 1.5rem;
}

.solution-card-header i {
    margin-right: 8px;
}

.solution-card .panel-body.solve {
    padding: 24px;
    font-size: 1.45rem;
    line-height: 1.9;
    color: #333;
}

.solution-card .panel-body.solve strong {
    color: #1b5e20;
}

.tip-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border-left: 4px solid #fbbf24;
}

.tip-card-header {
    background: linear-gradient(135deg, #e65100 0%, #f57c00 100%);
    color: #fff;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tip-card-header i {
    margin-right: 8px;
}

.btn-tts-modern {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 1.28rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tts-modern:hover {
    background: rgba(255,255,255,0.35);
}

.tip-card-body {
    padding: 24px;
    font-size: 1.45rem;
    line-height: 1.85;
    color: #444;
}

.tip-card-body strong {
    color: #e65100;
}

.answer-tip {
    margin-top: 20px;
    padding: 10px 16px;
    background: #e8f5e9;
    border-left: 3px solid #2e7d32;
    border-radius: 0 8px 8px 0;
    color: #1b5e20;
    font-size: 0.92rem;
    line-height: 1.5;
}

.answer-tip strong {
    color: #0a3d10;
}

.answer-tip em {
    background: #c8e6c9;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-style: normal;
    color: #1b5e20;
}

.graph-container {
    border: 2px solid #a5d6a7;
    border-radius: 12px;
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.page-help {
    clear: both;
}

.var-a { color: #1565c0; font-weight: bold; }
.var-b { color: #e53935; font-weight: bold; }
.var-c { color: #2e7d32; font-weight: bold; }
.var-d { color: #6a1b9a; font-weight: bold; }
.var-e { color: #e65100; font-weight: bold; }
.var-f { color: #00838f; font-weight: bold; }

#container-main {
    margin: 0 auto;
    padding: 0 16px;
}

@keyframes stepReveal {
    0%   { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes highlightPulse {
    0%   { background: transparent; }
    30%  { background: rgba(255,235,59,0.35); }
    100% { background: transparent; }
}

@keyframes underlineDraw {
    0%   { width: 0; }
    100% { width: 100%; }
}

@keyframes scalePop {
    0%   { opacity: 0; transform: scale(0.7); }
    60%  { transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideInLeft {
    0%   { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(6px); }
}

.anim-step {
    opacity: 0;
    animation: stepReveal 0.45s ease forwards;
    padding: 10px 14px;
    margin: 6px 0;
    border-left: 3px solid #2e7d32;
    border-radius: 6px;
    background: rgba(232,245,232,0.4);
}

.anim-step:nth-child(1) { animation-delay: 0.1s; }
.anim-step:nth-child(2) { animation-delay: 0.35s; }
.anim-step:nth-child(3) { animation-delay: 0.6s; }
.anim-step:nth-child(4) { animation-delay: 0.85s; }
.anim-step:nth-child(5) { animation-delay: 1.1s; }
.anim-step:nth-child(6) { animation-delay: 1.35s; }
.anim-step:nth-child(7) { animation-delay: 1.6s; }
.anim-step:nth-child(8) { animation-delay: 1.85s; }

.anim-highlight {
    animation: highlightPulse 1.2s ease 0.3s;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
}

.anim-answer {
    opacity: 0;
    animation: scalePop 0.5s ease forwards;
    animation-delay: 0.5s;
    display: inline-block;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 8px 16px;
    border-radius: 10px;
    border: 2px solid #43a047;
    font-weight: 700;
    margin-top: 8px;
}

.anim-fade {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.anim-slide {
    opacity: 0;
    animation: slideInLeft 0.4s ease forwards;
}

.anim-arrow {
    display: block;
    text-align: center;
    color: #66bb6a;
    font-size: 1.2rem;
    margin: 2px 0;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards, arrowBounce 1s ease infinite;
}

.anim-rule {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%);
    border: 2px solid #ffb74d;
    border-radius: 10px;
    padding: 12px 18px;
    margin: 10px 0;
    opacity: 0;
    animation: stepReveal 0.5s ease forwards;
}

.anim-example {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: 10px;
    padding: 12px 18px;
    margin: 10px 0;
    opacity: 0;
    animation: stepReveal 0.5s ease 0.3s forwards;
}

@media (prefers-reduced-motion: reduce) {
    .anim-step,
    .anim-highlight,
    .anim-answer,
    .anim-fade,
    .anim-slide,
    .anim-arrow,
    .anim-rule,
    .anim-example {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

.success-flash {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { box-shadow: inset 0 0 0 0 rgba(46,125,50,0); }
    50% { box-shadow: inset 0 0 0 4px rgba(46,125,50,0.3); }
    100% { box-shadow: inset 0 0 0 0 rgba(46,125,50,0); }
}

#calculatorModal .calc-modal-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 20px !important;
}

#calculatorModal .sc-calc {
    padding: 12px !important;
    background: #1a1a2e !important;
}

#calculatorModal .calc-display-wrap {
    background: #0f0f23 !important;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid #2a2a4a;
}

#calculatorModal .calc-status-bar {
    display: flex !important;
    gap: 8px;
    margin-bottom: 6px;
}

#calculatorModal .calc-status-btn {
    background: #2a2a4a !important;
    color: #a5d6a7 !important;
    border: none !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: auto !important;
    float: none !important;
}

#calculatorModal .calc-status-btn:hover {
    background: #3a3a5a !important;
}

#calculatorModal .calc-display {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #e0e0ff !important;
    font-family: 'Courier New', monospace !important;
    font-size: 1.7rem !important;
    text-align: right !important;
    outline: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    height: auto !important;
}

#calculatorModal .calc-history-panel {
    background: #0f0f23 !important;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #2a2a4a;
}

#calculatorModal .calc-history-item {
    display: flex !important;
    justify-content: space-between;
    padding: 4px 6px;
    font-size: 1.2rem;
    color: #8888aa;
    border-bottom: 1px solid #1a1a3a;
}

#calculatorModal .calc-history-item:last-child {
    border-bottom: none;
}

#calculatorModal .calc-history-expr {
    color: #8888aa;
}

#calculatorModal .calc-history-result {
    color: #a5d6a7;
    font-weight: 600;
}

#calculatorModal .calc-memory-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 8px;
}

#calculatorModal .calc-btn {
    padding: 12px 8px !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1 !important;
    width: auto !important;
    float: none !important;
    display: inline-block !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    margin: 0 !important;
    min-width: 0 !important;
}

#calculatorModal .calc-btn:active {
    transform: scale(0.94);
}

#calculatorModal .calc-btn.calc-btn-mem {
    font-size: 1.2rem !important;
    padding: 6px 4px !important;
    background: #1e1e3a !important;
    color: #7c7caa !important;
    border: 1px solid #2a2a4a !important;
}

#calculatorModal .calc-btn.calc-btn-mem:hover {
    background: #2a2a4a !important;
    color: #a5d6a7 !important;
}

#calculatorModal .calc-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
}

#calculatorModal .calc-btn-num {
    background: #2a2a4a !important;
    color: #e0e0ff !important;
    font-size: 1.5rem !important;
}

#calculatorModal .calc-btn-num:hover {
    background: #3a3a5a !important;
}

#calculatorModal .calc-btn-op {
    background: #1a3a2a !important;
    color: #81c784 !important;
    font-size: 1.5rem !important;
}

#calculatorModal .calc-btn-op:hover {
    background: #1e4a3a !important;
}

#calculatorModal .calc-btn-func {
    background: #1e1e3a !important;
    color: #9e9ebe !important;
    font-size: 1.3rem !important;
}

#calculatorModal .calc-btn-func:hover {
    background: #2a2a4a !important;
    color: #c0c0e0 !important;
}

#calculatorModal .calc-btn-eq {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
    color: #fff !important;
    font-size: 1.4rem !important;
}

#calculatorModal .calc-btn-eq:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%) !important;
}

#calculatorModal .calc-btn-clear {
    background: #4a1a2a !important;
    color: #ef9a9a !important;
    font-size: 1.5rem !important;
}

#calculatorModal .calc-btn-clear:hover {
    background: #5a2a3a !important;
}

#calculatorModal .calc-btn-del {
    background: #3a2a1a !important;
    color: #ffcc80 !important;
    font-size: 1.5rem !important;
}

#calculatorModal .calc-btn-del:hover {
    background: #4a3a2a !important;
}

#calculatorModal .calc-btn-flash {
    animation: calcFlash 0.3s ease;
}

@keyframes calcFlash {
    0% { box-shadow: 0 0 0 0 rgba(165,214,167,0.6); }
    50% { box-shadow: 0 0 12px 4px rgba(165,214,167,0.4); }
    100% { box-shadow: 0 0 0 0 rgba(165,214,167,0); }
}

@media (max-width: 767px) {
    .question-card-body {
        padding: 20px;
    }
    .question {
        font-size: 1.8rem;
    }
    .answer-section {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-submit-modern {
        width: 100%;
        text-align: center;
    }
    #container-main {
        padding: 0 8px;
    }
}