/* ==================== QUESTION CATEGORY BADGE ==================== */
.question-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.question-category-badge:empty {
    display: none;
}

/* Question meta row (category + community stats) */
.question-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

/* Community solve rate badge */
.community-stats {
    display: flex;
    align-items: center;
    gap: 4px;
}

.community-solve-rate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.25);
}

.community-solve-rate.easy {
    background: rgba(0, 206, 201, 0.12);
    color: var(--success);
    border-color: rgba(0, 206, 201, 0.25);
}

.community-solve-rate.medium {
    background: rgba(253, 203, 110, 0.12);
    color: #f39c12;
    border-color: rgba(253, 203, 110, 0.3);
}

.community-solve-rate.hard {
    background: rgba(255, 118, 117, 0.12);
    color: var(--error);
    border-color: rgba(255, 118, 117, 0.25);
}

/* ==================== QUESTION RATING & FEEDBACK ==================== */
.question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.question-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s, color 0.15s;
    color: var(--text-secondary);
    line-height: 1;
}

.star-btn.active,
.star-btn.hover-active {
    color: #ffd700;
}

@media (hover: hover) {
    .star-btn:hover {
        transform: scale(1.2);
    }
}

.star-btn:active {
    transform: scale(0.9);
}

.avg-rating {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.feedback-report-btn {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    white-space: nowrap;
}

/* Feedback Modal (inline, not overlay) */
.feedback-modal {
    margin-top: 10px;
    padding: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: fadeIn 0.2s ease-out;
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.feedback-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.feedback-option:has(input:checked) {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
}

.feedback-option input[type="radio"] {
    accent-color: var(--accent);
}

.feedback-comment {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 50px;
    max-height: 120px;
    margin-bottom: 8px;
    font-family: inherit;
}

.feedback-comment:focus {
    outline: none;
    border-color: var(--accent);
}

/* ==================== ANSWER HISTORY INDICATOR ==================== */
.history-indicator {
    margin-bottom: 12px;
    text-align: center;
}

.history-indicator.hidden {
    display: none;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.history-badge.history-correct {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 206, 201, 0.3);
}

.history-badge.history-wrong {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(255, 118, 117, 0.3);
}

.history-badge.history-new {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.3);
}

/* History Filter Dropdown Styling */
#historyFilter {
    min-width: 0;
    width: 100%;
}

/* Stats Actions (legacy — now uses .stats-danger-zone) */

/* ==================== STRIKETHROUGH OPTION ==================== */
.option-strikethrough-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 118, 117, 0.3);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.6;
}

.option-strikethrough-btn:hover {
    background: rgba(255, 118, 117, 0.15);
    color: var(--error);
    border-color: var(--error);
    opacity: 1;
}

.option.struck-out {
    background: rgba(255, 118, 117, 0.08) !important;
    border-color: rgba(255, 118, 117, 0.2) !important;
    position: relative;
}

.option.struck-out .text {
    text-decoration: line-through;
    text-decoration-color: var(--error);
    text-decoration-thickness: 2px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.option.struck-out .option-select-btn {
    opacity: 0.5;
    background: rgba(255, 118, 117, 0.2) !important;
}

.option.struck-out .option-strikethrough-btn {
    background: rgba(255, 118, 117, 0.2);
    color: var(--error);
    border-color: var(--error);
    opacity: 1;
}

.option.struck-out::after {
    content: '';
    position: absolute;
    left: 60px;
    right: 50px;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--error), transparent);
    opacity: 0.4;
}

/* Hide strikethrough button when option is disabled (answered) */
.option.disabled .option-strikethrough-btn {
    display: none;
}

/* Database Explanation Styles */
.db-explanation {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    text-align: left;
}

.db-explanation p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.db-explanation .explanation-tip {
    color: var(--warning);
    background: rgba(253, 203, 110, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.db-explanation .explanation-text {
    color: var(--text-primary);
    line-height: 1.7;
}

/* Option-level color coding in explanations */
.explanation-option-label {
    display: inline-block;
    font-weight: 700;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.explanation-option-label.opt-color-a {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.12);
}

.explanation-option-label.opt-color-b {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.12);
}

.explanation-option-label.opt-color-c {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.12);
}

.explanation-option-label.opt-color-d {
    color: #3498db;
    background: rgba(52, 152, 219, 0.12);
}

.explanation-option-label.opt-color-e {
    color: #9b59b6;
    background: rgba(155, 89, 182, 0.12);
}

.db-explanation .explanation-translation {
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(108, 92, 231, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.db-explanation .explanation-difficulty {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* GPT Inline Explain Button */
.gpt-explain-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.gpt-explain-inline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.gpt-explain-inline-btn:active {
    transform: translateY(0);
}

/* Panel Open - Responsive Layout (tek kaynak) */
/* 1025-1200px: side-by-side, panel 350px */
@media (max-width: 1200px) and (min-width: 1025px) {
    .gpt-chat-panel {
        width: 350px;
    }
    .app-wrapper.panel-open .container {
        transform: translateX(-7%);
    }
}

/* 769-1024px landscape: side-by-side, panel 340px */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .gpt-chat-panel {
        width: 340px;
    }
    .app-wrapper.panel-open .container {
        transform: translateX(-7%);
    }
}

/* 769-1024px portrait: overlay */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .gpt-chat-panel {
        width: 380px;
    }
    .app-wrapper.panel-open .container {
        margin-right: 0;
        opacity: 0.3;
        pointer-events: none;
    }
}

/* <=768px: full overlay */
@media (max-width: 768px) {
    .gpt-chat-panel {
        width: 100%;
        max-width: 100%;
    }
    .app-wrapper.panel-open .container {
        margin-right: 0;
        opacity: 0.3;
        pointer-events: none;
    }
}

@media (max-width: 600px) {
    .gpt-explain-inline-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

