/**
 * VGLoot - Game Detail Page Styles
 * Version: 1.0.0
 *
 * Estilos específicos para la página de detalle de juegos
 * Extraídos de estilos inline para mejor rendimiento y mantenibilidad
 */

/* ========================================
   LAYOUT
   ======================================== */

.game-detail-row {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* ========================================
   COVER IMAGE CONTAINER
   ======================================== */

.game-cover-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
}

.game-cover-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}

.game-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.game-cover-placeholder-icon {
    font-size: 3rem;
}

.game-cover-footer {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
}

.game-cover-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-cover-thumbnail {
    font-size: 0.75rem;
    transition: all 0.3s ease;
    border-color: #dee2e6;
}

.game-cover-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   CARD STYLES
   ======================================== */

.game-detail-card {
    border: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
    border-radius: 20px;
}

.game-collection-card-header {
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: 0;
    border-radius: 20px 20px 0 0;
}

.game-collection-card-title {
    margin-bottom: 0;
    font-weight: bold;
    font-size: 1.15rem;
}

/* ========================================
   EDITIONS GRID
   ======================================== */

.edition-card {
    height: 100%;
    border: 0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edition-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.edition-card-cover {
    height: 150px;
    object-fit: contain;
    background-color: #f8f9fa;
}

.edition-card-placeholder {
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
}

.edition-card-placeholder-icon {
    font-size: 2rem;
}

.edition-card-title {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.game-form-alert {
    background: rgba(13, 110, 253, 0.1);
    border: 0;
    margin-bottom: 1rem;
}

.game-form-select,
.game-form-input {
    border-radius: 10px;
}

.game-form-select:focus,
.game-form-input:focus {
    border-color: #20c997;
    box-shadow: 0 0 0 0.2rem rgba(32, 201, 151, 0.25);
}

/* ========================================
   PLATFORM ICONS
   ======================================== */

.platform-icon-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.platform-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.platform-icon:hover {
    transform: scale(1.1);
}

/* ========================================
   STATS & BADGES
   ======================================== */

.game-stats-badge {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 500;
}

.game-price-badge {
    font-size: 1.1rem;
    font-weight: bold;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    /* ---- Row margin ---- */
    .game-detail-row { padding-left: 0.4rem; padding-right: 0.4rem; }
    .game-detail-row > [class*="col-"] { padding-left: 0.35rem; padding-right: 0.35rem; }

    /* ---- Header hero section ---- */
    .row.mb-3 { margin-bottom: 0.4rem !important; }

    /* ---- ALL CARDS: compact spacing ---- */
    .game-detail-row .card.border-0 {
        margin-bottom: 0.4rem !important;
        border-radius: 10px !important;
    }
    .game-detail-row .card-header {
        padding: 0.4rem 0.65rem !important;
        border-radius: 10px 10px 0 0 !important;
    }
    .game-detail-row .card-header h5,
    .game-detail-row .card-header .fw-bold {
        font-size: 0.85rem !important;
    }
    .game-detail-row .card-body {
        padding: 0.45rem !important;
    }

    /* ---- Detail items y filas de precios: label izquierda, badge derecha ---- */
    .detail-item,
    .detail-row {
        padding: 0.28rem 0.45rem !important;
        font-size: 0.76rem;
    }
    .detail-item .fw-semibold,
    .detail-row .fw-semibold,
    .detail-row small { font-size: 0.76rem; }

    /* Forzar layout horizontal en todas las filas label/valor */
    .game-detail-row .d-flex.justify-content-between {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.3rem;
    }
    .game-detail-row .d-flex.justify-content-between > *:first-child { flex-shrink: 0; max-width: 55%; }
    .game-detail-row .d-flex.justify-content-between > *:last-child  { flex-shrink: 0; text-align: right; }

    .game-detail-row .badge {
        font-size: 0.67rem !important;
        padding: 0.18rem 0.4rem !important;
    }

    /* ---- Stats items ---- */
    .stat-item {
        padding: 0.28rem 0.45rem !important;
        margin-bottom: 0.25rem !important;
        font-size: 0.76rem;
    }
    .stat-item .fw-semibold { font-size: 0.76rem; }
    .stat-item .badge {
        font-size: 0.65rem !important;
        padding: 0.12rem 0.3rem !important;
    }
    .stat-item .progress { height: 3px !important; }
    .stat-item .mb-2 { margin-bottom: 0.2rem !important; }

    /* ---- game-mobile-hero: portada arriba, acciones debajo (columna) ---- */
    .game-mobile-hero {
        display: block;
        margin-bottom: 0.4rem;
    }
    .game-mobile-hero .game-cover-container {
        margin-bottom: 0.4rem !important;
        border-radius: 10px !important;
    }
    .game-mobile-hero .game-cover-image,
    .game-mobile-hero .game-cover-placeholder { height: 210px; }
    .game-mobile-hero > .card {
        font-size: 0.8rem;
    }
    .game-mobile-hero > .card .card-body { padding: 0.4rem !important; }
    .game-mobile-hero > .card .btn {
        font-size: 0.76rem;
        padding: 0.28rem 0.5rem;
    }
    /* Botones de acciones: fila horizontal compacta */
    .game-mobile-hero > .card .d-flex.gap-2 { gap: 0.35rem !important; }

    /* Cover sola (fuera del hero) */
    .game-cover-image, .game-cover-placeholder { height: 240px; }
    .game-cover-container { border-radius: 10px; }
    .game-cover-footer { padding: 8px; }

    /* Tarjetas de edición */
    .game-detail-card { border-radius: 10px; }
    .game-collection-card-header { border-radius: 10px 10px 0 0; }

    /* Platform badge footer */
    .game-cover-thumbnail { font-size: 0.67rem; padding: 0.18rem 0.4rem; }
}

@media (max-width: 480px) {
    .game-mobile-hero .game-cover-image,
    .game-mobile-hero .game-cover-placeholder { height: 185px; }

    .game-cover-image, .game-cover-placeholder { height: 200px; }

    .edition-card-cover,
    .edition-card-placeholder { height: 100px; }

    .detail-item, .stat-item { font-size: 0.72rem; }
    .detail-item .badge, .stat-item .badge { font-size: 0.62rem !important; }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

body.dark-mode .game-cover-container {
    background: #2d3748;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .game-cover-footer {
    background: #2d3748;
}

body.dark-mode .game-form-alert {
    background: rgba(13, 110, 253, 0.2);
}

body.dark-mode .edition-card {
    background: #2d3748;
}

body.dark-mode .edition-card-cover,
body.dark-mode .edition-card-placeholder {
    background-color: #1a202c;
}

body.dark-mode .game-form-select,
body.dark-mode .game-form-input {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .game-form-select:focus,
body.dark-mode .game-form-input:focus {
    background-color: #374151;
    border-color: #20c997;
}

/* ========================================
   STATS: versión compacta en móvil
   (1 columna, sin barra de progreso, sin %)
   ======================================== */
@media (max-width: 767px) {
    /* Items compactos en 1 columna */
    .stats-grid .stat-item {
        margin-bottom: 0.2rem !important;
        padding: 0.25rem 0.5rem !important;
        border-radius: 6px !important;
    }

    /* Ocultar barra de progreso, fondo translúcido y badge de % */
    .stats-grid .progress,
    .stats-grid .stat-item > .position-absolute,
    .stats-grid .stat-item .badge.bg-light {
        display: none !important;
    }

    /* Quitar mb-2 del row interno */
    .stats-grid .stat-item .d-flex.mb-2 {
        margin-bottom: 0 !important;
    }

    /* Texto del estado */
    .stats-grid .stat-item .fw-semibold {
        font-size: 0.72rem !important;
    }

    /* Badge de count */
    .stats-grid .stat-item .badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.4rem !important;
    }
}

/* ========================================
   ESPECIFICACIONES + COMPARACIÓN: móvil
   ======================================== */
@media (max-width: 767px) {
    /* Items de especificaciones más compactos */
    .spec-item {
        padding: 0.28rem 0.45rem !important;
    }
    .spec-item .d-flex {
        align-items: flex-start !important;
        gap: 0.4rem;
    }
    .spec-item .fw-semibold {
        font-size: 0.73rem !important;
        flex-shrink: 0;
        max-width: 42%;
    }
    .spec-item .badge {
        font-size: 0.67rem !important;
        padding: 0.18rem 0.38rem !important;
        white-space: normal !important;
        text-align: right;
        max-width: 56%;
        line-height: 1.3;
    }
    .specs-grid {
        gap: 0.25rem !important;
    }

    /* Selectores de modelo y comparación */
    #modelSelector,
    #comparisonPlatform {
        min-width: unset !important;
        max-width: 60% !important;
        font-size: 0.78rem !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
        padding-left: 0.4rem !important;
        padding-right: 2rem !important; /* espacio para la flecha */
    }

    /* Comparación: 1 columna en móvil */
    .comparison-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    .comparison-platform {
        padding: 0.6rem !important;
    }
    .comparison-platform h6 {
        font-size: 0.85rem !important;
    }
    .comparison-platform .spec-row,
    .comparison-platform [class*="spec"] {
        font-size: 0.75rem !important;
    }
}
