/**
 * File: game_detail/styles_v3.css
 * Location: /Coleco/cv_catalog/game_detail/styles_v3.css
 * Revision: 3.9
 * Date: 2026-04-20
 * Changes: Rev 3.9 - Added .platform-badge + size modifiers (pb-24 / pb-32 /
 *          pb-48) for inline icon platform-origin badges next to game title.
 *          Kept existing .origin-badge-detail styles for backward compat
 *          (used elsewhere in the site), but the detail-page subtitle now
 *          renders the icon badge via view_v3.php Rev 6.0 instead.
 *          Rev 3.8 - Fixed Chrome Mobile Viewport Issue
 *
 * This version properly handles iPad Chrome's mobile view which reports incorrect viewport
 */

@charset "utf-8";

/* ===== Base Styles ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000;
    margin: 0;
    padding: 0;
    color: #ffffff;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

/* ===== Compact Header ===== */
.game-header-compact {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.game-header-compact h1 {
    color: #FFFF00;
    font-size: 1.8em;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.publisher-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.publisher-name {
    color: #2154a6;
    font-weight: bold;
    font-size: 1.1em;
}

.year, .category {
    color: #ccc;
    font-size: 0.95em;
}

.separator {
    color: #666;
}

.collection-badge-header {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.collection-badge-header.collected {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #ffffff;
}

.collection-badge-header.needed {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: #ffffff;
}

.collection-badge-header.wishlist {
    background: linear-gradient(135deg, #ffc107, #f8ce0b);
    color: #000000;
}

/* ===== ORIGIN/PORT BADGE ===== */
.origin-badge-detail {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    background: #5C6BC0;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.origin-badge-detail.origin-arcade { background: #E65100; }
.origin-badge-detail.origin-msx { background: #1565C0; }
.origin-badge-detail.origin-sg_1000 { background: #00838F; }
.origin-badge-detail.origin-sord_m5 { background: #6A1B9A; }
.origin-badge-detail.origin-nes { background: #C62828; }
.origin-badge-detail.origin-atari_2600 { background: #827717; }
.origin-badge-detail.origin-atari_8_bit { background: #9E9D24; }
.origin-badge-detail.origin-intellivision { background: #2E7D32; }
.origin-badge-detail.origin-pc { background: #37474F; }
.origin-badge-detail.origin-commodore_64 { background: #4527A0; }
.origin-badge-detail.origin-zx_spectrum { background: #AD1457; }
.origin-badge-detail.origin-apple_ii { background: #558B2F; }
.origin-badge-detail.origin-ti_99_4a { background: #795548; }
.origin-badge-detail.origin-original { background: #2E7D32; }

/* ===== PLATFORM ICON BADGE (Rev 3.9) =====
   Inline icon badge rendered next to H1 game title by view_v3.php
   via renderPlatformBadge(). Loads SVG wordmark logos from
   /Coleco/cv_catalog/assets/icons/platforms/. Size modifiers:
   pb-24, pb-32 (default), pb-48. Add .platform-badge-label-hidden
   to hide the text label for an icon-only layout. */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
    margin-left: 12px;
    padding: 2px 10px 2px 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    line-height: 1;
    text-decoration: none;
    font-size: 1rem; /* break out of H1 inherited size */
}
.platform-badge img {
    display: block;
    width: auto;
    height: 32px; /* default (pb-32) */
    object-fit: contain;
    flex-shrink: 0;
}
.platform-badge-label {
    font-size: 0.72em;
    font-weight: 600;
    color: #cfd8dc;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.platform-badge.platform-badge-label-hidden .platform-badge-label { display: none; }
.platform-badge.pb-24 img { height: 24px; }
.platform-badge.pb-32 img { height: 32px; }
.platform-badge.pb-48 img { height: 48px; }
.platform-badge.pb-48 .platform-badge-label { font-size: 0.85em; }

/* Tablet */
@media (max-width: 1024px) {
    .platform-badge {
        margin-left: 10px;
        gap: 6px;
        padding: 2px 8px 2px 4px;
    }
    .platform-badge img { height: 26px; }
    .platform-badge-label { font-size: 0.68em; }
}

/* Mobile */
@media (max-width: 599px) {
    .platform-badge {
        margin-left: 0;
        margin-top: 6px;
        padding: 2px 6px 2px 3px;
    }
    .platform-badge img { height: 22px; }
    .platform-badge-label { font-size: 0.65em; }
    /* Let the badge drop to its own line under a long title on narrow screens */
    h1 .platform-badge { display: inline-flex; }
}

/* ===== MAIN GRID - DEFAULT TWO COLUMNS ===== */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== Images Column ===== */
.images-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-cluster {
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #333;
}

.cluster-title {
    color: #FFFF00;
    font-size: 1em;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #2154a6;
}

.box-art-stacked {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}

.box-art-item {
    position: relative;
    background: #0a0a0a;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #333;
    transition: all 0.3s ease;
    max-width: 100%;
}

.box-art-item:hover {
    border-color: #FFFF00;
}

.box-art-item img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    object-fit: contain;
}

.image-item {
    position: relative;
    background: #0a0a0a;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #333;
    transition: all 0.3s ease;
}

.image-item:hover {
    border-color: #FFFF00;
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

.clickable-image:hover {
    opacity: 0.9;
}

.image-label {
    padding: 6px;
    background: rgba(0,0,0,0.8);
    color: #FFFF00;
    font-size: 11px;
    text-align: center;
    font-weight: bold;
}

.image-label-small {
    padding: 4px;
    background: rgba(0,0,0,0.8);
    color: #ccc;
    font-size: 10px;
    text-align: center;
}

.image-item.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: #0a0a0a;
}

.no-image {
    color: #555;
    font-size: 12px;
}

.placeholder-image {
    opacity: 0.5;
    filter: grayscale(50%);
}

.box-art-item.empty {
    min-height: 200px;
}

.box-art-item.empty .image-label {
    background: rgba(128, 0, 0, 0.8);
    color: #ccc;
}

.cartridge-section-relocated {
    margin-top: 0;
}

.cartridge-grid-horizontal {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.cartridge-grid-horizontal .image-item.small {
    flex: 0 0 auto;
    width: 80px;
}

.cartridge-grid-horizontal .image-item.small img {
    max-height: 100px;
    object-fit: contain;
    width: 100%;
}

.rom-download-section {
    padding: 15px;
    text-align: center;
}

.btn-rom-download {
    display: inline-block;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.btn-rom-download:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.download-icon {
    margin-right: 8px;
    font-size: 16px;
}

.rom-info {
    margin-top: 10px;
    color: #ccc;
    font-size: 13px;
}

.rom-size-label {
    color: #2154a6;
    font-weight: bold;
    margin-right: 6px;
}

.info-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.info-card h3 {
    color: #FFFF00;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2154a6;
}

.info-grid-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.info-column-left,
.info-column-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.info-label {
    color: #2154a6;
    font-weight: bold;
    min-width: 100px;
    font-size: 14px;
}

.info-value {
    color: #ffffff;
    font-size: 14px;
}

.info-highlight {
    color: #FFFF00;
    font-weight: bold;
}

.badge-controller,
.badge-overlay {
    background: #2154a6;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.badge-rom {
    background: #8B0000;
    color: white;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.description-card-compact {
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid #333;
}

.description-card-compact h3 {
    color: #FFFF00;
    font-size: 1em;
    margin: 0 0 8px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #2154a6;
}

.description-text {
    color: #e0e0e0;
    font-size: 0.95em;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}

.description-text::-webkit-scrollbar {
    width: 6px;
}

.description-text::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.description-text::-webkit-scrollbar-thumb {
    background: #2154a6;
    border-radius: 3px;
}

.tabs-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: #0a0a0a;
    border-bottom: 2px solid #2154a6;
}

.tab-button {
    flex: 1;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: #888;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #333;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #1a1a1a;
    color: #FFFF00;
}

.tab-button.active {
    background: linear-gradient(135deg, #2154a6, #1a4280);
    color: #FFFF00;
}

.tab-content {
    display: none;
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.media-section-full {
    margin-bottom: 25px;
}

.media-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.media-column {
    display: flex;
    flex-direction: column;
}

.section-title {
    color: #FFFF00;
    font-size: 16px;
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #2154a6;
}

.media-gallery-vertical {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.media-gallery-vertical .media-item img {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

.media-gallery-horizontal {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.media-gallery-horizontal .media-item {
    flex: 0 0 auto;
}

.media-gallery-horizontal .media-item img {
    width: 180px;
    height: 145px;
    object-fit: contain;
}

.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    justify-items: center;
}

.media-gallery-grid .media-item img {
    width: 180px;
    height: 240px;
    object-fit: contain;
}

.media-item img {
    border: 2px solid #2154a6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #000;
}

.media-item img:hover {
    border-color: #FFFF00;
    transform: scale(1.05);
}

.image-caption {
    text-align: center;
    color: #ccc;
    font-size: 11px;
    margin-top: 4px;
}

.back-link {
    text-align: center;
    margin: 20px 0;
}

.back-link a {
    display: inline-block;
    color: #2154a6;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #2154a6;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-link a:hover {
    background: #2154a6;
    color: white;
}

.admin-tools-compact {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #2a1a1a, #3a2020);
    border-radius: 8px;
    border: 1px solid #543333;
    margin-bottom: 20px;
}

.btn-admin {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background: #2154a6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-admin:hover {
    background: #1a4280;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border: 3px solid #ff6600;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.5);
    transition: transform 0.2s ease;
    cursor: move;
    transform-origin: center center;
}

.modal .close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #FFFF00;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10002;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.modal .close:hover {
    color: #fff;
    transform: scale(1.2);
}

.modal-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 25px;
    border: 2px solid #FFFF00;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FFFF00;
    background: rgba(0, 0, 0, 0.9);
    color: #FFFF00;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #FFFF00;
    color: #000;
    transform: scale(1.1);
}

.zoom-indicator {
    display: flex;
    align-items: center;
    color: #FFFF00;
    font-weight: bold;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
    justify-content: center;
}

.modal-instructions {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #FFFF00;
    color: #FFFF00;
    padding: 10px 15px;
    font-size: 12px;
    z-index: 10001;
    border-radius: 8px;
    line-height: 1.6;
    max-width: 200px;
}

.modal-instructions h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #FFFF00;
    padding-bottom: 5px;
}

.modal-instructions div {
    margin: 3px 0;
}

#modalCaption {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #FFFF00;
    font-weight: bold;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 30px;
    border-radius: 5px;
    z-index: 10001;
    max-width: 80%;
}

/* ===== RESPONSIVE DESIGN - FIX FOR CHROME MOBILE VIEW ON IPAD ===== */

/* iPad - Narrow left column but KEEP two columns */
@media (max-width: 1024px) and (min-width: 600px) {
    .main-grid {
        grid-template-columns: 320px 1fr;
        gap: 15px;
    }
    
    .container {
        padding: 12px;
    }
    
    .media-two-column {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .info-grid-two-column {
        gap: 20px;
    }
}

/* ACTUAL PHONES ONLY - Single column */
@media (max-width: 599px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    .game-header-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .game-header-compact h1 {
        font-size: 1.5em;
    }
    
    .publisher-info {
        font-size: 0.95em;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .tab-button {
        border-right: none;
        border-bottom: 1px solid #333;
        padding: 10px 12px;
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .info-grid-two-column {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .media-two-column {
        grid-template-columns: 1fr;
    }
    
    .modal-instructions {
        font-size: 11px;
        max-width: 150px;
        top: 15px;
        left: 15px;
    }

    .modal-controls {
        bottom: 20px;
        padding: 8px 12px;
        gap: 10px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    #modalCaption {
        bottom: 80px;
        font-size: 14px;
        padding: 8px 20px;
    }
    
    .modal .close {
        font-size: 40px;
        top: 15px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .game-header-compact h1 {
        font-size: 1.3em;
    }
    
    .publisher-info {
        font-size: 0.85em;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .separator {
        display: none;
    }
    
    .tab-button {
        font-size: 0.85em;
    }
    
    .info-label {
        min-width: 80px;
        font-size: 13px;
    }
    
    .info-value {
        font-size: 13px;
    }
}