/* ========================================
   Prüfungswissen – Frontend Styles
   ======================================== */

/* Allgemeines */
.pw-loading { text-align: center; color: #666; padding: 40px; }

/* ========================================
   Suchbox und Katalog
   ======================================== */
.pw-search-box {
    margin-bottom: 24px;
}

.pw-search-box input {
    width: 100%;
    padding: 14px 20px;
    font-size: 17px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pw-search-box input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

/* Kategorie-Filter */
#pw-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.pw-cat-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pw-cat-btn:hover, .pw-cat-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Pruefungs-Karten */
.pw-exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.pw-exam-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.1s;
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
}

.pw-exam-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.pw-exam-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1a1a1a;
}

.pw-exam-card .pw-exam-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #666;
    margin-top: 12px;
}

.pw-exam-card .pw-exam-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pw-exam-card .pw-exam-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pw-exam-cat-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f0f6fc;
    color: #2271b1;
    border-radius: 10px;
}

.pw-favorite-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.pw-favorite-btn:hover, .pw-favorite-btn.is-favorite {
    opacity: 1;
}

.pw-no-results {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ========================================
   Quiz
   ======================================== */
#pw-quiz-app {
    margin-top: 32px;
}

.pw-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.pw-quiz-modes {
    display: flex;
    gap: 8px;
}

.pw-mode-btn {
    padding: 10px 20px;
    border: 2px solid #2271b1;
    border-radius: 8px;
    background: #fff;
    color: #2271b1;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.pw-mode-btn:hover, .pw-mode-btn.active {
    background: #2271b1;
    color: #fff;
}

/* Fortschrittsbalken */
.pw-progress-bar {
    width: 100%;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.pw-progress-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 4px;
    transition: width 0.3s;
}

/* Timer */
.pw-timer {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding: 8px 16px;
    background: #f8f8f8;
    border-radius: 8px;
}

.pw-timer.warning { color: #dba617; }
.pw-timer.danger { color: #d63638; }

/* Frage */
.pw-question-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
}

.pw-question-number {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.pw-question-topic {
    font-size: 12px;
    color: #2271b1;
    background: #f0f6fc;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 12px;
}

.pw-question-text {
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* Antwort-Optionen */
.pw-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pw-option {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.15s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pw-option:hover {
    border-color: #2271b1;
    background: #f8fbff;
}

.pw-option.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.pw-option.correct {
    border-color: #00a32a;
    background: #f0faf0;
}

.pw-option.wrong {
    border-color: #d63638;
    background: #fdf0f0;
}

.pw-option.disabled {
    cursor: default;
    pointer-events: none;
}

.pw-option-letter {
    font-weight: 600;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e8e8e8;
    font-size: 13px;
    flex-shrink: 0;
}

.pw-option.correct .pw-option-letter { background: #00a32a; color: #fff; }
.pw-option.wrong .pw-option-letter { background: #d63638; color: #fff; }
.pw-option.selected .pw-option-letter { background: #2271b1; color: #fff; }

/* Erklaerung */
.pw-explanation {
    margin-top: 16px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Navigation */
.pw-quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.pw-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pw-btn-primary {
    background: #2271b1;
    color: #fff;
}

.pw-btn-primary:hover { background: #1a5a8e; }

.pw-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.pw-btn-secondary:hover { background: #e0e0e0; }

.pw-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Melden-Button */
.pw-report-btn {
    font-size: 13px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
}

.pw-report-btn:hover { color: #d63638; }

/* ========================================
   Ergebnis-Anzeige
   ======================================== */
.pw-result-card {
    text-align: center;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 40px;
}

.pw-result-score {
    font-size: 64px;
    font-weight: 700;
    margin: 16px 0;
}

.pw-result-score.pass { color: #00a32a; }
.pw-result-score.fail { color: #d63638; }

.pw-result-details {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
    color: #666;
}

.pw-result-message {
    font-size: 20px;
    margin-bottom: 16px;
}

.pw-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

/* Fortschritts-Verlauf */
.pw-history {
    margin-top: 32px;
}

.pw-history-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0 8px;
}

.pw-history-bar {
    flex: 1;
    min-width: 20px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.3s;
}

.pw-history-bar.pass { background: #00a32a; }
.pw-history-bar.fail { background: #d63638; }

/* ========================================
   Hinweis: Anmelden fuer Fortschritt
   ======================================== */
.pw-login-hint {
    background: #f0f6fc;
    border: 1px solid #c5ddf5;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.pw-login-hint a {
    color: #2271b1;
    font-weight: 500;
}

/* ========================================
   Responsive: Handy-Optimierung
   ======================================== */
@media (max-width: 600px) {
    .pw-exam-grid {
        grid-template-columns: 1fr;
    }
    
    .pw-question-card {
        padding: 18px;
    }
    
    .pw-question-text {
        font-size: 16px;
    }
    
    .pw-option {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .pw-result-score {
        font-size: 48px;
    }
    
    .pw-result-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .pw-quiz-modes {
        width: 100%;
    }
    
    .pw-mode-btn {
        flex: 1;
        text-align: center;
        font-size: 14px;
        padding: 8px 12px;
    }
}
