/**
 * game_detail/styles_v3.css - Modernized Compact Styles with Tabs
 * Location: /Coleco/cv_catalog/game_detail/styles_v3.css
 * 
 * Author: ColecoVision Game Library System
 * Created: 2025-01-17
 * Updated: 2025-01-18
 * Version: 3.5
 * 
 * Description: Compact, space-efficient styles with improved modal
 * 
 * UTF-8 Encoding: ✓
 */

@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;
}

/* ===== Main Grid Layout ===== */
.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 Vertically - CONSTRAINED */
.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 styling */
.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 - horizontal layout */
.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 */
.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 ===== */
.info-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Game Information Box - Two Column Layout */
.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 */
.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 ===== */
.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 Tab Layout ===== */
.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 ===== */
.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 ===== */
.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;
}

/* ===== IMPROVED MODAL STYLES ===== */

/* Modal Overlay */
.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 Content Container - Centers everything */
.modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Image */
.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;
}

/* Close Button */
.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);
}

/* Zoom Controls - Positioned relative to viewport */
.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 Level Indicator */
.zoom-indicator {
    display: flex;
    align-items: center;
    color: #FFFF00;
    font-weight: bold;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
    justify-content: center;
}

/* Instructions - Compact overlay */
.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;
}

/* Caption */
#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 ===== */
@media (max-width: 1024px) {
    .media-two-column {
        grid-template-columns: 1fr;
    }
    
    .info-grid-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .game-header-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tabs-header {
        flex-direction: column;
    }
    
    .tab-button {
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .info-grid-two-column {
        grid-template-columns: 1fr;
    }
    
    /* Modal responsive adjustments */
    .modal-instructions {
        font-size: 11px;
        max-width: 150px;
    }

    .modal-controls {
        bottom: 20px;
        padding: 8px 12px;
    }

    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    #modalCaption {
        bottom: 80px;
        font-size: 14px;
    }
    
    .modal .close {
        font-size: 40px;
        top: 15px;
        right: 20px;
    }
}