/* ============================================
   UNIFIED REPORT MODAL — Dark Mode
   Covers: Main Post, Ad, and Event report modals
   ============================================ */

/* --- Animations --- */
@keyframes reportModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes reportModalSlideIn {
    from { transform: scale(0.95) translateY(-20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- Event Menu Button (3-dot trigger in event cards) --- */
.event-menu-col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-right: 8px;
    flex-shrink: 0;
}

.btn-event-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 28px;
    min-height: 32px;
}

.btn-event-menu:hover {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.3);
}

.event-menu-dot {
    display: block;
    width: 4px;
    height: 4px;
    background: var(--muted, #888);
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-event-menu:hover .event-menu-dot {
    background: #e74c3c;
}

/* === MODAL OVERLAY === */
.main-report-modal,
.ad-report-modal,
.event-report-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: reportModalFadeIn 0.3s ease;
}

.main-report-modal[aria-hidden="true"],
.ad-report-modal[aria-hidden="true"],
.event-report-modal[aria-hidden="true"] {
    display: none !important;
}

.main-report-modal[aria-hidden="false"],
.ad-report-modal[aria-hidden="false"],
.event-report-modal[aria-hidden="false"] {
    display: flex !important;
}

/* --- Backdrop --- */
.main-report-modal-overlay,
.ad-report-modal-overlay,
.event-report-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* === MODAL CONTENT BOX === */
.main-report-modal-content,
.ad-report-modal-content,
.event-report-modal-content {
    position: relative;
    z-index: 1;
    background: var(--surface-2, #1e2a3a);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: reportModalSlideIn 0.3s ease;
}

/* === HEADER === */
.main-report-modal-header,
.ad-report-modal-header,
.event-report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.12), transparent);
}

.main-report-modal-header h2,
.ad-report-modal-header h2,
.event-report-modal-header h2 {
    margin: 0;
    font-size: 1.15em;
    color: #e74c3c;
    font-weight: 600;
}

/* --- Close Button --- */
.main-report-close,
.ad-report-close,
.event-report-close {
    background: transparent;
    border: none;
    color: var(--muted, #888);
    font-size: 1.6em;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.main-report-close:hover,
.ad-report-close:hover,
.event-report-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* === FORM === */
.main-report-form,
.ad-report-form,
.event-report-form {
    padding: 20px;
}

.main-report-section,
.ad-report-section,
.event-report-section {
    margin-bottom: 16px;
}

.main-report-section:last-of-type,
.ad-report-section:last-of-type,
.event-report-section:last-of-type {
    margin-bottom: 20px;
}

/* --- Section Label --- */
.main-report-label,
.ad-report-label,
.event-report-label {
    display: block;
    font-size: 0.95em;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 10px;
}

/* === RADIO BUTTON REASONS === */
.main-report-reasons,
.ad-report-reasons,
.event-report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding: 2px;
}

.main-report-reason,
.ad-report-reason,
.event-report-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #e0e0e0;
}

.main-report-reason:hover,
.ad-report-reason:hover,
.event-report-reason:hover {
    background: rgba(231, 76, 60, 0.06);
    border-color: rgba(231, 76, 60, 0.3);
}

.main-report-reason input[type="radio"],
.ad-report-reason input[type="radio"],
.event-report-reason input[type="radio"] {
    accent-color: #e74c3c;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Selected reason highlight */
.main-report-reason:has(input[type="radio"]:checked),
.ad-report-reason:has(input[type="radio"]:checked),
.event-report-reason:has(input[type="radio"]:checked) {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.5);
}

.main-report-reason input[type="radio"]:checked + .reason-text,
.ad-report-reason input[type="radio"]:checked + .reason-text,
.event-report-reason input[type="radio"]:checked + .reason-text {
    color: #e74c3c;
    font-weight: 500;
}

/* --- Reason Text --- */
.main-report-reason .reason-text,
.ad-report-reason .reason-text,
.event-report-reason .reason-text {
    font-size: 0.95em;
    color: #e0e0e0;
    transition: color 0.2s ease;
    line-height: 1.4;
}

/* === DESCRIPTION / COMMENT SECTION === */
#descriptionSection {
    background: rgba(255, 152, 0, 0.08);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

#descriptionSection.visible {
    display: block !important;
}

/* === TEXTAREA === */
.main-report-textarea,
.ad-report-textarea,
.event-report-textarea {
    width: 100%;
    height: 100px;
    padding: 10px 12px;
    background-color: #2a3847;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    color: #e0e0e0;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
}

.main-report-textarea::placeholder,
.ad-report-textarea::placeholder,
.event-report-textarea::placeholder {
    color: #888;
}

.main-report-textarea:focus,
.ad-report-textarea:focus,
.event-report-textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
    background-color: #2a3847;
    color: #e0e0e0;
}

/* --- Character Count --- */
.main-report-char-count,
.ad-report-char-count,
.event-report-char-count {
    text-align: right;
    font-size: 0.8em;
    color: #999;
    margin-top: 4px;
}

.main-report-char-count span,
.ad-report-char-count span,
.event-report-char-count span {
    color: #999;
}

/* === ACTION BUTTONS === */
.main-report-actions,
.ad-report-actions,
.event-report-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
}

/* --- Cancel --- */
.main-report-btn-cancel,
.ad-report-btn-cancel,
.event-report-btn-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    color: #e0e0e0;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
}

.main-report-btn-cancel:hover,
.ad-report-btn-cancel:hover,
.event-report-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.main-report-btn-cancel:active,
.ad-report-btn-cancel:active,
.event-report-btn-cancel:active {
    transform: translateY(1px);
}

/* --- Submit --- */
.main-report-btn-submit,
.ad-report-btn-submit,
.event-report-btn-submit {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.main-report-btn-submit:hover:not(:disabled),
.ad-report-btn-submit:hover:not(:disabled),
.event-report-btn-submit:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.main-report-btn-submit:active:not(:disabled),
.ad-report-btn-submit:active:not(:disabled),
.event-report-btn-submit:active:not(:disabled) {
    transform: translateY(1px);
}

.main-report-btn-submit:disabled,
.ad-report-btn-submit:disabled,
.event-report-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === REPORTED STATE OVERLAYS === */
.main-post-card.reported {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.main-post-card.reported::after {
    content: '✓ Reported';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.85);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 10;
}

.ad-container.reported {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.ad-container.reported::after {
    content: 'Reported';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.85);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 10;
}

.event-card.reported {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.event-card.reported::after {
    content: 'Reported';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.85);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    z-index: 10;
}

/* === SCROLLBAR (dark) === */
.main-report-modal-content::-webkit-scrollbar,
.main-report-reasons::-webkit-scrollbar,
.ad-report-modal-content::-webkit-scrollbar,
.ad-report-reasons::-webkit-scrollbar,
.event-report-modal-content::-webkit-scrollbar,
.event-report-reasons::-webkit-scrollbar {
    width: 8px;
}

.main-report-modal-content::-webkit-scrollbar-track,
.main-report-reasons::-webkit-scrollbar-track,
.ad-report-modal-content::-webkit-scrollbar-track,
.ad-report-reasons::-webkit-scrollbar-track,
.event-report-modal-content::-webkit-scrollbar-track,
.event-report-reasons::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.main-report-modal-content::-webkit-scrollbar-thumb,
.main-report-reasons::-webkit-scrollbar-thumb,
.ad-report-modal-content::-webkit-scrollbar-thumb,
.ad-report-reasons::-webkit-scrollbar-thumb,
.event-report-modal-content::-webkit-scrollbar-thumb,
.event-report-reasons::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.main-report-modal-content::-webkit-scrollbar-thumb:hover,
.main-report-reasons::-webkit-scrollbar-thumb:hover,
.ad-report-modal-content::-webkit-scrollbar-thumb:hover,
.ad-report-reasons::-webkit-scrollbar-thumb:hover,
.event-report-modal-content::-webkit-scrollbar-thumb:hover,
.event-report-reasons::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .main-report-modal-content,
    .ad-report-modal-content,
    .event-report-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .main-report-modal-header,
    .ad-report-modal-header,
    .event-report-modal-header {
        padding: 14px 16px;
    }

    .main-report-modal-header h2,
    .ad-report-modal-header h2,
    .event-report-modal-header h2 {
        font-size: 1.05em;
    }

    .main-report-form,
    .ad-report-form,
    .event-report-form {
        padding: 14px;
    }

    .main-report-actions,
    .ad-report-actions,
    .event-report-actions {
        flex-direction: column;
        padding: 14px 16px;
    }

    .main-report-btn-cancel,
    .main-report-btn-submit,
    .ad-report-btn-cancel,
    .ad-report-btn-submit,
    .event-report-btn-cancel,
    .event-report-btn-submit {
        width: 100%;
    }

    .main-report-reasons,
    .ad-report-reasons,
    .event-report-reasons {
        max-height: 300px;
    }
}