/* =============================================================================
   REPORTS — Single Post Layout
   Both rows are direct children of .content-area-wrapper (a flex column).
   Mirrors the theme's main + widget-area flexbox pattern.
   ============================================================================= */

/* ── Make .content-area-wrapper a column for this template ───────────────────
   The theme sets it to flex-row (for main + native sidebar).
   On single report pages we override it so our two rows stack vertically.    */

.mrwin-reports-page .content-area-wrapper {
    flex-direction: column;
    gap: 0;
}

/* ── Row 1: Report section (centred to --content-width) ──────────────────── */

.mrwin-reports-full-row {
    width: 100%;
}

.mrwin-reports-full-row .mrwin-report-section {
    max-width: var(--content-width, 700px);
    margin-inline: auto;
    width: 100%;
}

/* ── Row 2: Two-column flexbox (exactly like theme's main + widget-area) ──── */

.mrwin-twocol-section {
    display: flex;
    flex-direction: row;
    gap: 40px;           /* same gap as .content-area-wrapper in main.css */
    align-items: flex-start;
    width: 100%;
    margin-top: 2rem;
}

/* Left column — editor content: flex:1, max-width matches --content-width */
.mrwin-twocol-content {
    flex: 1;
    max-width: var(--content-width, 700px);
    min-width: 0; /* prevent flex overflow */
}

/* Right column — service sidebar: fixed to --sidebar-width, same as .widget-area */
.mrwin-service-sidebar {
    flex: 0 0 var(--sidebar-width, 300px);
    max-width: var(--sidebar-width, 300px);
    background: var(--content-bg, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9rem;
}

.mrwin-service-sidebar.is-sticky {
    position: sticky;
    top: 2rem;
}

body.dark-mode .mrwin-service-sidebar {
    border-color: var(--border-color, #333);
}

/* ── Sidebar Hero (image + title) ─────────────────────────────────────────── */

.reports-sidebar__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    text-align: center;
}

.reports-sidebar__hero-img {
    width: 250px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.reports-sidebar__service-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* ── Sidebar Review rating and description ───────────────────────────────── */

.reports-sidebar__review {
    padding: 1.25rem 1rem;
    background: var(--outer-bg, #f7f7f7);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.reports-sidebar__rating-box {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    background: var(--status-success, #57C84D);
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 800;
    align-self: center;
    box-shadow: 0 4px 12px rgba(87, 200, 77, 0.25);
}

.reports-sidebar__rating-box .rating-value {
    font-size: 1.5rem;
    line-height: 1;
}

.reports-sidebar__rating-box .rating-max {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1;
}

.reports-sidebar__review-desc {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-color, #333);
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

body.dark-mode .reports-sidebar__review {
    background: rgba(255, 255, 255, 0.03);
}

/* ── Star rating system ─────────────────────────────────────────────────── */

.reports-sidebar__rating-stars {
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 5px;
    cursor: pointer;
}

.star {
    width: 32px;
    height: 32px;
    background-color: var(--rating-star-empty, #ddd);
    -webkit-mask-image: url('../img/star.svg');
    mask-image: url('../img/star.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.2s, transform 0.15s;
    display: inline-block;
}

/* Hover effect */
.star:hover,
.star:hover ~ .star {
    background-color: var(--rating-star-filled, #ffbb00);
    transform: scale(1.1);
}

/* Active (clicked) */
.star.active,
.star.active ~ .star {
    background-color: var(--rating-star-filled, #ffbb00);
}

.rating-submission-wrap {
    width: 100%;
    min-height: 42px; /* Roughly the height of the button */
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-rating-btn {
    width: 100%;
    height: 42px; /* Fixed height to match with response */
    padding: 0; 
    border-radius: 6px;
    border: 1px solid var(--border-color, #ccc);
    background: var(--content-bg, #fff);
    color: var(--text-color, #333);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-rating-btn:hover:not(:disabled) {
    background: var(--outer-bg, #f7f7f7);
    border-color: #999;
}

.submit-rating-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rating-response {
    width: 100%;
    min-height: 42px;
    font-size: 0.78rem;
    text-align: center;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rating-summary {
    font-weight: 600;
    color: var(--text-color-light, #888);
}

.rating-success-msg {
    color: var(--status-success, #57C84D);
    font-weight: 700;
    display: block;
}

.rating-error-msg {
    color: var(--status-critical, #ef3e4b);
}

/* ── Section header label ─────────────────────────────────────────────────── */

.reports-sidebar__section-heading {
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-color-light, #888);
    background: var(--outer-bg, #f7f7f7);
    border-top: 1px solid var(--border-color, #e0e0e0);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

/* ── Social network pills ─────────────────────────────────────────────────── */

.reports-sidebar__social {
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reports-sidebar__social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background-color: var(--social-btn-bg, #444);
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.reports-sidebar__social-btn:hover {
    opacity: 0.85;
    transform: scale(1.04);
    color: #fff;
}

.reports-sidebar__social-btn .reports-sidebar-icon-mask {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: #fff;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Snapchat specific bright yellow requires dark text/icon */
.reports-sidebar__social-btn[style*="#FFFC00"] {
    color: #000;
}
.reports-sidebar__social-btn[style*="#FFFC00"]:hover {
    color: #000;
}
.reports-sidebar__social-btn[style*="#FFFC00"] .reports-sidebar-icon-mask {
    background-color: #000;
}

/* ── App / Download buttons ───────────────────────────────────────────────── */

.reports-sidebar__apps {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reports-sidebar__app-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 1.2;
}

.reports-sidebar__app-btn:hover {
    opacity: 0.85;
    transform: scale(1.04);
    color: #fff;
}

body.dark-mode .reports-sidebar__app-btn {
    border-color: rgba(255, 255, 255, 0.2);
}

.reports-sidebar__app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.reports-sidebar__app-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.reports-sidebar__app-label {
    flex: 1;
}

/* ── Sidebar Status Check ─────────────────────────────────────────────────── */

.reports-sidebar__status {
    padding: 0.75rem 1rem 1.25rem;
}

/* Override .web-status defaults when inside the sidebar aside */
.mrwin-service-sidebar .web-status {
    width: 100%;
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    border: none;
    background-color: #1d65a6;
}

.mrwin-service-sidebar .web-status:hover {
    opacity: 0.85;
    transform: scale(1.04);
}

.mrwin-service-sidebar .web-status-svg {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mrwin-service-sidebar .web-status-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mrwin-service-sidebar .web-status-text {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: left;
    flex: 1;
    line-height: 1.3;
    color: white;
}

/* ── Publisher Information ────────────────────────────────────────────────── */

.reports-sidebar__publisher {
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.reports-sidebar__publisher .publisher-logo {
    width: 250px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.reports-sidebar__publisher .publisher-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reports-sidebar__publisher .publisher-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.reports-sidebar__publisher .publisher-info-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.82rem;
}

.reports-sidebar__publisher .publisher-info-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.4;
}

.reports-sidebar__publisher .info-label {
    font-weight: 600;
    color: var(--text-color-light, #888);
    flex-shrink: 0;
}

.reports-sidebar__publisher .info-value {
    text-align: right;
    word-break: break-word;
}

/* Responsive — collapse to single column ───────────────────────────────── */

@media screen and (max-width: 900px) {
    .mrwin-twocol-section {
        flex-direction: column;
        gap: 1.5rem;
    }

    .mrwin-twocol-content,
    .mrwin-service-sidebar {
        max-width: 100%;
        flex-basis: auto;
        position: static;
        width: 100%;
    }

    /* Pull the sidebar above the content on mobile.
       Order: report row → sidebar → content → comments */
    .mrwin-service-sidebar {
        order: -1;
    }

    /* Disable sticky on mobile — it would overlap scrolled content */
    .mrwin-service-sidebar.is-sticky {
        position: static;
        top: auto;
    }
}
