/**
 * Quiz Bug Reporter - スタイル
 * Version: 2.2.0
 */

/* CSS変数 */
:root {
    --qbr-primary: #f59e0b;
    --qbr-primary-dark: #d97706;
    --qbr-primary-light: #fbbf24;
    --qbr-bg-dark: #1e293b;
    --qbr-bg-medium: #334155;
    --qbr-bg-light: #475569;
    --qbr-text: #f8fafc;
    --qbr-text-muted: #94a3b8;
    --qbr-border: #475569;
    --qbr-success: #22c55e;
    --qbr-error: #ef4444;
    --qbr-gradient: linear-gradient(135deg, var(--qbr-primary) 0%, var(--qbr-primary-dark) 100%);
}

/* 報告ボタン */
.qbr-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #fff !important;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    margin: 8px 0 8px 10px;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
    vertical-align: middle;
}

.qbr-report-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.qbr-report-btn .btn-icon {
    font-size: 14px;
}

/* レッスンページ用ボタン */
.qbr-lesson-btn {
    display: block;
    margin: 15px 0;
    width: fit-content;
}

/* モーダルオーバーレイ */
.qbr-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.qbr-modal-overlay.active {
    display: flex;
}

/* モーダル本体 */
.qbr-modal {
    background: var(--qbr-bg-dark);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: qbr-modal-in 0.3s ease;
}

@keyframes qbr-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* モーダルヘッダー */
.qbr-modal-header {
    background: var(--qbr-gradient);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.qbr-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.qbr-modal-title .header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.qbr-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.qbr-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* モーダルボディ */
.qbr-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* 修正対象情報 */
.qbr-target-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.qbr-target-title {
    color: #60a5fa;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.qbr-target-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qbr-target-row {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.qbr-target-label {
    color: var(--qbr-text-muted);
    min-width: 80px;
}

.qbr-target-value {
    color: var(--qbr-text);
    font-weight: 600;
}

/* 説明文 */
.qbr-description {
    background: var(--qbr-bg-medium);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid var(--qbr-primary);
}

.qbr-description p {
    color: var(--qbr-text);
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 10px 0;
}

.qbr-description p:last-child {
    margin-bottom: 0;
}

.qbr-description .qbr-description-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--qbr-primary-light);
    margin-bottom: 12px;
}

.qbr-description .qbr-thanks {
    color: var(--qbr-primary-light);
    font-size: 12px;
    line-height: 1.6;
    margin-top: 10px;
    padding: 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
}

.qbr-description .qbr-note {
    color: var(--qbr-text-muted);
    font-size: 11px;
    line-height: 1.6;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--qbr-border);
}

/* カテゴリ選択 */
.qbr-category-section {
    margin-bottom: 20px;
}

.qbr-section-label {
    color: var(--qbr-text);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.qbr-category-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.qbr-category-card {
    flex: 1 1 calc(50% - 5px);
    min-width: 140px;
    background: var(--qbr-bg-medium);
    border: 2px solid var(--qbr-border);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.qbr-category-card .card-text {
    color: var(--qbr-text);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}

.qbr-category-card:hover {
    border-color: var(--qbr-primary);
    background: var(--qbr-bg-light);
}

.qbr-category-card.selected {
    border-color: var(--qbr-primary);
    background: rgba(245, 158, 11, 0.15);
}

.qbr-category-card .card-icon {
    font-size: 24px;
    margin-bottom: 6px;
}


/* 詳細入力 */
.qbr-detail-section {
    margin-bottom: 20px;
}

.qbr-detail-textarea {
    width: 100%;
    background: var(--qbr-bg-medium);
    border: 2px solid var(--qbr-border);
    border-radius: 10px;
    padding: 12px;
    color: #ffffff !important;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff;
}

.qbr-detail-textarea:focus {
    outline: none;
    border-color: var(--qbr-primary);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.qbr-detail-textarea::placeholder {
    color: var(--qbr-text-muted);
    -webkit-text-fill-color: var(--qbr-text-muted);
}

/* 送信ボタン */
.qbr-submit-btn {
    width: 100%;
    background: var(--qbr-gradient);
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qbr-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.qbr-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 完了画面 */
.qbr-success-view {
    display: none;
    text-align: center;
    padding: 30px 20px;
}

.qbr-success-view.active {
    display: block;
}

.qbr-success-icon {
    font-size: 60px;
    margin-bottom: 24px;
}

.qbr-success-title {
    color: var(--qbr-success);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.qbr-success-message {
    color: var(--qbr-text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.qbr-close-modal-btn {
    background: var(--qbr-bg-medium);
    border: 2px solid var(--qbr-border);
    border-radius: 10px;
    padding: 12px 30px;
    color: var(--qbr-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qbr-close-modal-btn:hover {
    border-color: var(--qbr-primary);
    background: var(--qbr-bg-light);
}

/* エラーメッセージ */
.qbr-error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--qbr-error);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--qbr-error);
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.qbr-error-message.active {
    display: block;
}

/* フォーム表示/非表示 */
.qbr-form-view {
    display: block;
}

.qbr-form-view.hidden {
    display: none;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .qbr-modal {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .qbr-modal-header {
        padding: 14px 16px;
    }
    
    .qbr-modal-title {
        font-size: 14px;
    }
    
    .qbr-modal-body {
        padding: 16px;
    }
    
    .qbr-category-card {
        flex: 1 1 100%;
    }
    
    .qbr-report-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

