/**
 * IHK Test System - Frontend Styles
 * 
 * Test-Interface Styling ausgelagert aus der Hauptdatei
 * 
 * @package IHK_Test_System
 * @since 2.0.0
 */

/* ============================================================================
   TEST APP CONTAINER
   ============================================================================ */

.ihk-test-app {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ============================================================================
   SCREEN MANAGEMENT
   ============================================================================ */

.test-screen {
    display: none;
    padding: 20px;
}

.test-screen.active {
    display: block;
}

/* ============================================================================
   START SCREEN
   ============================================================================ */

.test-start-card {
    background: #f8f9ff;
    border: 2px solid #007bff;
    color: #212529;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.test-header {
    margin-bottom: 30px;
}

.test-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    color: #007bff;
}

.test-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #495057;
}

.test-info-list {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.test-info-row {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    text-align: left;
}

.info-label {
    font-size: 0.9em;
    color: #6c757d;
    font-weight: normal;
}

.info-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #212529;
}

.test-start-actions {
    margin-top: 30px;
}

.btn-start-test {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 2px solid #28a745;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    font-weight: 600;
}

.btn-start-test:hover {
    background: rgba(40, 167, 69, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40,167,69,0.4);
}

/* ============================================================================
   QUESTION CONTAINER
   ============================================================================ */

.question-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    min-height: 400px;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.test-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.test-progress-inline {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.test-category-inline {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.test-timer-inline {
    font-weight: 700;
    font-size: 16px;
    color: #28a745;
}

.test-timer-inline.warning {
    color: #ffc107;
}

.test-timer-inline.danger {
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-nav, .btn-finish, .btn-secondary, .btn-submit {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-nav {
    background: #6c757d;
    color: white;
}

.btn-nav:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-finish {
    background: #007bff;
    color: white;
}

.btn-finish:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* ============================================================================
   SUBMIT CONFIRMATION
   ============================================================================ */

.submit-confirmation {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.submit-confirmation h2 {
    color: #333;
    margin-bottom: 15px;
}

.submit-confirmation p {
    color: #666;
    margin-bottom: 10px;
}

.submit-actions {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-submit {
    background: #dc3545;
    color: white;
}

.btn-submit:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .test-start-card {
        padding: 25px;
    }
    
    .test-title {
        font-size: 1.8em;
    }
    
    .test-description {
        font-size: 1em;
    }
    
    .test-info-row {
        padding: 15px;
    }
    
    .test-navigation {
        flex-wrap: wrap;
    }
    
    .submit-actions {
        flex-direction: column;
    }
    
    .btn-nav, .btn-finish, .btn-secondary, .btn-submit {
        width: 100%;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================================================
   TIMER WARNINGS
   ============================================================================ */

.test-timer-inline.timer-warning {
    color: #fd7e14;
    animation: pulse-warning 1s infinite;
}

.test-timer-inline.timer-critical {
    color: #dc3545;
    animation: pulse-critical 0.5s infinite;
    font-weight: bold;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.test-timer-inline.timer-expired {
    color: #ff0000;
    background-color: #ffe6e6;
    padding: 8px 12px;
    border-radius: 4px;
    animation: flash-expired 0.5s infinite;
    font-weight: bold;
}

@keyframes flash-expired {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================================================
   FRAGMENT DISPLAY (KOMPAKT auf einer Zeile)
   ============================================================================ */

.ihk-fragments-display {
    display: block !important;
    background: #f8f9ff;
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    color: #212529;
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box;
    overflow: visible !important;
}

.fragment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.fragment-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #007bff;
}

.fragment-icon {
    font-size: 20px;
}

.fragment-number {
    font-size: 24px;
    line-height: 1;
}

.fragment-hints {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.hint-button {
    background: white;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hint-button:hover:not(:disabled) {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

.hint-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #6c757d;
    color: #6c757d;
}

.tts-toggle-button {
    background: white;
    border: 2px solid #007bff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-toggle-button:hover {
    background: #007bff;
    transform: scale(1.1);
}

.tts-toggle-button .tts-icon {
    font-size: 20px;
    line-height: 1;
}

/* ============================================================================
   ANSWER OPTIONS (INLINE Checkboxen/Radio-Buttons)
   ============================================================================ */

.ihk-answer-options {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin: 10px 0;
}

.ihk-answer-option {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 2px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ihk-answer-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.ihk-answer-option.selected {
    background: #e7f3ff;
    border-color: #007bff;
}

.ihk-answer-option.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.ihk-answer-option.wrong-answer {
    background: #f8d7da;
    border-color: #dc3545;
}

.ihk-answer-option input[type="checkbox"],
.ihk-answer-option input[type="radio"] {
    display: none;
}

.ihk-answer-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    flex: 1;
}

.ihk-answer-option .answer-letter {
    font-weight: 700;
    color: #007bff;
    min-width: 20px;
}

.ihk-answer-option .answer-text {
    flex: 1;
}

.ihk-answer-option input:disabled {
    cursor: not-allowed;
}

/* ============================================================================
   QUESTION STYLING
   ============================================================================ */

.ihk-question-text {
    margin-bottom: 20px;
}

.ihk-question-text h3 {
    font-size: 1.3em;
    color: #212529;
    margin-bottom: 0;
}

/* Entferne den Mehrfachauswahl-Hinweis Style (wird nicht mehr gebraucht) */
.question-hint {
    display: none;
}

/* ============================================================================
   SHORT ANSWER INPUT STYLES (Kurzantwort-Felder)
   ============================================================================ */

.ihk-short-answer-container {
    margin: 10px 0 25px;
    padding: 10px 0;
    width: 100%;
}

.ihk-short-answer-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    line-height: 1.4;
    color: #495057;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 8px;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    font-family: inherit;
}

.ihk-short-answer-input:focus {
    border-color: #007bff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.ihk-short-answer-input:hover:not(:focus) {
    border-color: #adb5bd;
}

.ihk-short-answer-input::placeholder {
    color: #adb5bd;
    opacity: 0.75;
}

.ihk-short-answer-input:disabled,
.ihk-short-answer-input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

.ihk-short-answer-hint {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    line-height: 1.4;
}

/* ============================================================================
   COPY-PASTE-SCHUTZ
   ============================================================================ */

.ihk-test-app .ihk-question-text,
.ihk-test-app .ihk-answer-options,
.ihk-test-app .ihk-option-text {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.ihk-test-app .ihk-short-answer-input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
