/* ── Unified Review Modal ─────────────────────────────────────────────────
   Used by both index.html (game-modal) and wishlist.html (review-modal).
   Two-column layout: left = cover art + steam link, right = form + reviews.
   ────────────────────────────────────────────────────────────────────────── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 100;
}
.modal-backdrop.active { display: block; }

/* Shared modal shell */
.review-modal,
.game-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 820px;
    max-height: 88vh;
    background-color: #1a1d26;
    border: 1px solid var(--btn-nav-border);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
    display: none;
    z-index: 101;
    overflow: hidden;
}
.review-modal.active,
.game-modal.active { display: flex; flex-direction: column; }

/* ── Header bar ── */
.review-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--btn-nav-border);
    flex-shrink: 0;
}

.review-modal-game {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.review-modal-cover-sm {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--card-border);
    flex-shrink: 0;
}

.review-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.review-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 520px;
}

.review-modal-price {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: bold;
}

.review-modal-close {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--btn-section);
    border: 1px solid var(--btn-section-border);
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.review-modal-close:hover { color: var(--accent-sale); border-color: var(--accent-sale); }

/* ── Two-column body ── */
.review-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    min-height: 0;
}

/* Left column — large cover art */
.review-modal-cover-panel {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-right: 1px solid var(--btn-nav-border);
}

.review-modal-cover-lg {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    display: block;
}

.review-modal-steam-btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 7px;
    background-color: var(--accent-primary);
    color: #0d0e13;
    font-family: "IntelOneMono", monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.review-modal-steam-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* Right column — form + reviews */
.review-modal-right {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ── Write review form ── */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 10px;
    background: var(--btn-section);
    border: 1px solid var(--btn-section-border);
}

.review-form-title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.star-input {
    display: flex;
    gap: 4px;
}

.star-btn {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.15s ease;
}
.star-btn .material-symbols-outlined {
    font-size: 28px;
    font-variation-settings: 'FILL' 0;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.star-btn.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
    color: #fbbf24;
}
.star-btn:hover { transform: scale(1.2); }

.comment-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input {
    all: unset;
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    box-sizing: border-box;
    border-radius: 8px;
    background: var(--btn-section-hover);
    border: 1px solid var(--btn-section-border);
    color: var(--text-main);
    font-family: "IntelOneMono", monospace;
    font-size: 13px;
    resize: none;
    transition: border-color 0.2s ease;
    line-height: 1.5;
}
.comment-input:focus { border-color: var(--accent-primary); }
.comment-input::placeholder { color: var(--text-muted); }

.comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.char-count {
    font-size: 11px;
    color: var(--text-muted);
}

.submit-btn {
    all: unset;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #0d0e13;
    font-family: "IntelOneMono", monospace;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}
.submit-btn:hover { filter: brightness(1.15); }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.submit-btn .material-symbols-outlined { font-size: 16px; }

/* ── Reviews list ── */
.reviews-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reviews-section-title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-count {
    background: var(--btn-section);
    border: 1px solid var(--btn-section-border);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reviews-loading {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.review-item {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--btn-section);
    border: 1px solid var(--btn-section-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.review-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-username {
    font-weight: bold;
    font-size: 13px;
    color: var(--accent-primary);
}

.review-stars {
    color: #fbbf24;
    font-size: 13px;
    letter-spacing: 1px;
}

.review-time {
    font-size: 11px;
    color: var(--text-muted);
}

.review-comment {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    opacity: 0.85;
}

.no-reviews {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Scrollbar styling for modal right panel */
.review-modal-right::-webkit-scrollbar { width: 6px; }
.review-modal-right::-webkit-scrollbar-track { background: var(--btn-section); border-radius: 3px; }
.review-modal-right::-webkit-scrollbar-thumb { background: var(--btn-section-hover); border-radius: 3px; }
.review-modal-right::-webkit-scrollbar-thumb:hover { background: var(--btn-section-hover-border); }
