/* ═══════════════════════════════════════════════════════
   CCL Dashboard v3 — Issue Reporter Styles
   Pattern B: Error modal  |  Pattern C: Feedback button
   ═══════════════════════════════════════════════════════ */

/* ─── Modal Overlay ─── */
.issue-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--slow);
}

.issue-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── Modal Card ─── */
.issue-modal {
    background: white;
    border-radius: var(--r-xl);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--slow);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.issue-modal-overlay.active .issue-modal {
    transform: scale(1);
}

/* ─── Modal Header ─── */
.issue-modal-header {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-8);
    border-bottom: 1px solid var(--gray-100);
}

.issue-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.issue-modal-icon.error {
    background: var(--error-wash);
    color: var(--error);
}

.issue-modal-icon.feedback {
    background: var(--teal-subtle);
    color: var(--teal);
}

.issue-modal-header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 var(--s-1) 0;
}

.issue-modal-header-text p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

.issue-modal-close {
    position: absolute;
    top: var(--s-6);
    right: var(--s-6);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--s-1);
    border-radius: var(--r-sm);
    transition: all var(--fast);
}

.issue-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ─── Modal Body ─── */
.issue-modal-body {
    padding: var(--s-8);
}

.issue-modal-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 var(--s-4) 0;
}

/* ─── Error Message Display ─── */
.error-message-display {
    background: var(--error-wash);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    margin-bottom: var(--s-6);
    font-size: 0.8125rem;
    color: var(--error);
    font-family: var(--font-mono);
    word-break: break-word;
}

/* ─── Category Radio Buttons ─── */
.issue-categories {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-bottom: var(--s-6);
}

.issue-category {
    display: flex;
    align-items: flex-start;
    gap: var(--s-4);
    padding: var(--s-4);
    background: var(--gray-50);
    border: 1.5px solid transparent;
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: all var(--fast);
}

.issue-category:hover {
    background: white;
    border-color: var(--gray-200);
}

.issue-category.selected {
    background: white;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.issue-category input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    margin-top: 2px;
    flex-shrink: 0;
    transition: all var(--fast);
    position: relative;
}

.issue-category input[type="radio"]:checked {
    border-color: var(--teal);
    background: var(--teal);
}

.issue-category input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.category-content {
    flex: 1;
}

.category-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.4;
    display: block;
}

.category-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--s-1);
    display: none;
}

.issue-category.selected .category-hint {
    display: block;
}

/* ─── Hint Box (Self-resolvable) ─── */
.issue-hint-box {
    background: var(--success-wash);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    margin-bottom: var(--s-6);
    display: none;
}

.issue-hint-box.visible {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
}

.issue-hint-box .hint-icon {
    color: var(--success);
    flex-shrink: 0;
}

.issue-hint-box .hint-text {
    font-size: 0.8125rem;
    color: var(--success);
    line-height: 1.5;
}

/* ─── Details Textarea ─── */
.issue-details-section {
    margin-bottom: var(--s-6);
    display: none;
}

.issue-details-section.visible {
    display: block;
}

.issue-details-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--s-2);
}

.issue-details-section textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--s-4);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--r-lg);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--gray-800);
    resize: vertical;
    transition: all var(--fast);
    box-sizing: border-box;
}

.issue-details-section textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.issue-details-section textarea::placeholder {
    color: var(--gray-400);
}

/* ─── Checkbox ─── */
.issue-checkbox {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 0.8125rem;
    color: var(--gray-600);
    cursor: pointer;
    margin-bottom: var(--s-6);
}

.issue-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--r-sm);
    flex-shrink: 0;
    transition: all var(--fast);
    position: relative;
}

.issue-checkbox input[type="checkbox"]:checked {
    background: var(--teal);
    border-color: var(--teal);
}

.issue-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ─── Modal Footer ─── */
.issue-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--s-4);
    padding: var(--s-6) var(--s-8);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* ─── Feedback Button (fixed bottom-right) ─── */
.feedback-button {
    position: fixed;
    bottom: var(--s-8);
    right: var(--s-8);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-6);
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--r-full);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--base);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.feedback-button:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-teal);
}

.feedback-button:hover .feedback-icon {
    color: white;
}

.feedback-icon {
    color: var(--gray-400);
    transition: color var(--fast);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .issue-modal {
        width: 95%;
        margin: var(--s-4);
    }

    .issue-modal-header {
        padding: var(--s-6);
    }

    .issue-modal-body {
        padding: var(--s-6);
    }

    .issue-modal-footer {
        padding: var(--s-4) var(--s-6);
        flex-direction: column;
    }

    .issue-modal-footer .btn-primary,
    .issue-modal-footer .btn-ghost {
        width: 100%;
    }

    .feedback-button {
        bottom: var(--s-6);
        right: var(--s-6);
        padding: var(--s-2) var(--s-4);
        font-size: 0.75rem;
    }
}
