/* ==========================================
   LOSTVERSE
   CONTENT REPORT STYLESHEET
   Comment & Private Message Reporting
========================================== */

/* ==========================================
   01. DESIGN SYSTEM
========================================== */

.content-report-dialog {
    --cr-navy: #142b4b;
    --cr-blue: #2456b8;
    --cr-blue-dark: #19469f;
    --cr-text: #334155;
    --cr-muted: #64748b;
    --cr-border: #e2e8f0;
    --cr-surface: #ffffff;
    --cr-background: #f8fafc;
    --cr-success: #15803d;
    --cr-danger: #b91c1c;

    width: min(480px, calc(100% - 32px));

    max-height: 85vh;
    max-height: 85dvh;

    margin: auto;
    padding: 26px;

    box-sizing: border-box;

    border: 1px solid var(--cr-border);
    border-radius: 16px;

    background: var(--cr-surface);
    color: var(--cr-navy);

    font-family:
        'Noto Sans Thai',
        Tahoma,
        sans-serif;

    font-size: 14px;
    line-height: 1.7;

    overflow-y: auto;
    overscroll-behavior: contain;

    scrollbar-width: thin;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, .18);
}

.content-report-dialog *,
.content-report-dialog *::before,
.content-report-dialog *::after {
    box-sizing: border-box;
}

.content-report-dialog:not([open]),
.content-report-dialog [hidden] {
    display: none !important;
}

.content-report-dialog::backdrop {
    background: rgba(15, 23, 42, .55);

    backdrop-filter: blur(3px);
}

/* ==========================================
   02. DIALOG HEADER
========================================== */

.content-report-dialog .cr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 14px;
}

.content-report-dialog h2 {
    margin: 0;

    color: var(--cr-navy);

    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
}

.cr-header-icon {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border-radius: 10px;

    background: #f1f5f9;
    color: var(--cr-navy);
}

.cr-header-icon svg {
    width: 21px;
    height: 21px;
}

/* ==========================================
   03. CLOSE BUTTON
========================================== */

#cr-close {
    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #f1f5f9;
    color: #64748b;

    font: inherit;
    font-size: 23px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 180ms ease,
        color 180ms ease;
}

#cr-close:not(:disabled):hover {
    background: #e2e8f0;
    color: #142b4b;
}

#cr-close:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ==========================================
   04. DESCRIPTION
========================================== */

.content-report-dialog .cr-description {
    margin: 12px 0 18px;

    color: var(--cr-muted);

    font-size: 13px;
    line-height: 1.8;

    overflow-wrap: anywhere;
}

.cr-privacy-notice {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin: 14px 0;
    padding: 12px;

    border: 1px solid #dbeafe;
    border-radius: 8px;

    background: #eff6ff;
    color: #1e40af;

    font-size: 12px;
    line-height: 1.8;
}

.cr-privacy-notice svg {
    width: 17px;
    height: 17px;

    flex-shrink: 0;
}

.cr-privacy-notice p {
    margin: 0;
}

/* ==========================================
   05. REPORTED CONTENT PREVIEW
========================================== */

#cr-preview {
    max-height: 130px;

    margin: 18px 0;
    padding: 14px 16px;

    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 8px;

    background: #f8fafc;
    color: #334155;

    font-size: 13px;
    line-height: 1.8;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    overflow-y: auto;
    overscroll-behavior: contain;

    scrollbar-width: thin;
}

#cr-preview:empty {
    display: none;
}

.cr-preview-label {
    display: block;

    margin-bottom: 6px;

    color: var(--cr-muted);

    font-size: 11px;
    font-weight: 600;
}

/* ==========================================
   06. REPORT FORM
========================================== */

.content-report-dialog form {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 0;

    background: transparent;

    box-shadow: none;
}

.content-report-dialog .cr-fields,
.content-report-dialog #cr-fields {
    min-width: 0;
}

.content-report-dialog label {
    display: block;

    margin: 16px 0 8px;

    color: var(--cr-navy);

    font-size: 13px;
    font-weight: 600;
}

.content-report-dialog select,
.content-report-dialog textarea {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 12px 14px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;
    color: var(--cr-text);

    font: inherit;
    font-size: 14px;

    outline: none;

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.content-report-dialog select {
    min-height: 44px;

    cursor: pointer;
}

.content-report-dialog textarea {
    min-height: 110px;
    max-height: 260px;

    resize: vertical;
}

.content-report-dialog textarea::placeholder {
    color: #94a3b8;
}

.content-report-dialog select:focus,
.content-report-dialog textarea:focus {
    border-color: var(--cr-blue);

    box-shadow:
        0 0 0 3px rgba(36, 86, 184, .09);
}

.content-report-dialog select:disabled,
.content-report-dialog textarea:disabled {
    background: #f1f5f9;
    color: #94a3b8;

    cursor: not-allowed;
}

.content-report-dialog [aria-invalid="true"] {
    border-color: #dc2626;
}

.cr-field-hint {
    display: block;

    margin-top: 6px;

    color: var(--cr-muted);

    font-size: 11px;
    line-height: 1.7;
}

.cr-character-count {
    display: block;

    margin-top: 6px;

    color: var(--cr-muted);

    text-align: right;

    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   07. DIALOG ACTIONS
========================================== */

.content-report-dialog .cr-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid var(--cr-border);
}

.content-report-dialog .cr-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    width: auto;
    min-height: 42px;

    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: 8px;

    font: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}

#cr-cancel {
    border-color: #dbe2ea;

    background: #ffffff;
    color: #475569;
}

#cr-cancel:not(:disabled):hover {
    border-color: #cbd5e1;

    background: #f1f5f9;
}

#cr-submit {
    border-color: #2456b8;

    background: #2456b8;
    color: #ffffff;
}

#cr-submit:not(:disabled):hover {
    border-color: #19469f;

    background: #19469f;
}

#cr-submit:disabled,
#cr-cancel:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.content-report-dialog button:focus-visible {
    outline: 3px solid #93b4ed;
    outline-offset: 3px;
}

/* ==========================================
   08. REPORT STATUS MESSAGES
========================================== */

#cr-status {
    margin: 16px 0 0;

    font-size: 13px;
    line-height: 1.8;

    overflow-wrap: anywhere;
}

#cr-status:empty {
    display: none;
}

.cr-success {
    color: #15803d;
}

.cr-error {
    color: #b91c1c;
}

#cr-status.cr-success {
    padding: 14px;

    border: 1px solid #bbf7d0;
    border-radius: 8px;

    background: #f0fdf4;
    color: #166534;
}

#cr-status.cr-error {
    padding: 14px;

    border: 1px solid #fecaca;
    border-radius: 8px;

    background: #fef2f2;
    color: #b91c1c;
}

#cr-status.cr-info {
    padding: 14px;

    border: 1px solid #dbeafe;
    border-radius: 8px;

    background: #eff6ff;
    color: #1e40af;
}

#cr-status.cr-warning {
    padding: 14px;

    border: 1px solid #fde68a;
    border-radius: 8px;

    background: #fffbeb;
    color: #92400e;
}

/* ==========================================
   09. REPORT TRIGGER BUTTON
========================================== */

button.content-report-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    width: auto;
    min-width: 0;
    min-height: 26px;

    margin: 0;
    padding: 4px 7px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #64748b;

    font: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;

    white-space: nowrap;

    cursor: pointer;

    box-shadow: none;

    transition:
        background 180ms ease,
        color 180ms ease;
}

.content-report-trigger svg {
    width: 14px;
    height: 14px;

    flex-shrink: 0;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

button.content-report-trigger:not(:disabled):hover {
    background: #fef2f2;
    color: #b91c1c;
}

button.content-report-trigger:focus-visible {
    outline: 2px solid #93b4ed;
    outline-offset: 2px;
}

button.content-report-trigger:disabled {
    opacity: .5;
    cursor: not-allowed;
}

button.content-report-trigger[hidden] {
    display: none !important;
}

/* ==========================================
   10. COMMENT REPORT INTEGRATION
========================================== */

.comment-actions .content-report-trigger {
    margin-left: 2px;
}

.comment-actions .content-report-trigger svg {
    width: 13px;
    height: 13px;
}

.comment-actions .content-report-trigger span {
    font-size: 11px;
}

/* ==========================================
   11. PRIVATE MESSAGE REPORT INTEGRATION
========================================== */

.message-row .content-report-trigger {
    align-self: flex-start;

    margin-top: 2px;
}

.message-row.mine .content-report-trigger,
.message-row.deleted .content-report-trigger {
    display: none !important;
}

/* ==========================================
   12. REPORT HISTORY STATUS
========================================== */

.content-report-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    width: fit-content;

    padding: 5px 9px;

    border: 1px solid transparent;
    border-radius: 6px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.content-report-status.pending {
    border-color: #fde68a;

    background: #fffbeb;
    color: #92400e;
}

.content-report-status.reviewing {
    border-color: #bfdbfe;

    background: #eff6ff;
    color: #1d4ed8;
}

.content-report-status.resolved {
    border-color: #bbf7d0;

    background: #f0fdf4;
    color: #166534;
}

.content-report-status.dismissed {
    border-color: #e2e8f0;

    background: #f1f5f9;
    color: #64748b;
}

/* ==========================================
   13. REPORT HISTORY CARDS
========================================== */

.content-report-history {
    display: grid;

    gap: 12px;
}

.content-report-history-card {
    min-width: 0;

    padding: 16px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;
}

.content-report-history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 10px;
}

.content-report-history-header strong {
    color: #142b4b;

    font-size: 14px;
    font-weight: 600;
}

.content-report-history-card p {
    margin: 8px 0;

    color: #475569;

    font-size: 13px;
    line-height: 1.8;

    overflow-wrap: anywhere;
}

.content-report-history-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px 16px;

    color: #64748b;

    font-size: 11px;
}

/* ==========================================
   14. LOADING & EMPTY STATES
========================================== */

.cr-loading {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 20px 12px;

    color: #64748b;

    font-size: 13px;
}

.cr-spinner {
    width: 18px;
    height: 18px;

    flex-shrink: 0;

    border: 2px solid #dbeafe;
    border-top-color: #2456b8;
    border-radius: 50%;

    animation:
        cr-spin .8s linear infinite;
}

@keyframes cr-spin {

    to {
        transform: rotate(360deg);
    }

}

.cr-empty {
    padding: 24px 16px;

    color: #64748b;

    text-align: center;

    font-size: 13px;
    line-height: 1.8;
}

/* ==========================================
   15. MOBILE RESPONSIVE
========================================== */

@media (max-width: 600px) {

    .content-report-dialog {
        width: calc(100% - 24px);

        max-height: 90vh;
        max-height: 90dvh;

        padding: 20px;

        border-radius: 14px;
    }

    .content-report-dialog h2 {
        font-size: 19px;
    }

    .content-report-dialog select,
    .content-report-dialog textarea {
        font-size: 16px;
    }

    #cr-preview {
        max-height: 100px;

        padding: 12px;
    }

    .content-report-dialog .cr-actions {
        gap: 8px;
    }

    .content-report-dialog .cr-actions button {
        flex: 1;
    }

    button.content-report-trigger {
        min-height: 32px;

        padding: 6px 8px;
    }

}

/* ==========================================
   16. SMALL MOBILE
========================================== */

@media (max-width: 360px) {

    .content-report-dialog {
        padding: 16px;
    }

    .content-report-dialog h2 {
        font-size: 17px;
    }

    .content-report-dialog .cr-description {
        font-size: 12px;
    }

    .content-report-dialog .cr-actions button {
        padding: 10px 12px;

        font-size: 12px;
    }

}

/* ==========================================
   17. ACCESSIBILITY
========================================== */

@media (prefers-reduced-motion: reduce) {

    .content-report-dialog *,
    .content-report-trigger {
        transition: none !important;
        animation: none !important;
    }

}