/**
 * Game Player Styles
 * Estilos para la página de juego embebido (estilo Juegos.com)
 *
 * @package GameFuga
 * @since 3.1
 */

/* ==========================================================================
   Layout Principal del Juego
   ========================================================================== */

.single-game {
    background: #0f172a;
    min-height: 100vh;
    padding: 0;
}

.single-game article {
    margin: 0;
    padding: 0;
}

.game-player-layout {
    display: grid;
    grid-template-columns: 60px 1fr 220px;
    min-height: calc(100vh - 200px);
    background: #1e293b;
}

/* ==========================================================================
   Sidebar Izquierdo - Acciones
   ========================================================================== */

.game-sidebar-left {
    background: #0f172a;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #334155;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 20px;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #475569;
    color: #f1f5f9;
    transform: translateY(-2px);
}

.action-btn svg {
    width: 22px;
    height: 22px;
}

.action-btn .count {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* Like Button */
.action-btn.action-like:hover,
.action-btn.action-like.active {
    background: #10b981;
    color: #fff;
}

/* Dislike Button */
.action-btn.action-dislike:hover,
.action-btn.action-dislike.active {
    background: #ef4444;
    color: #fff;
}

.action-separator {
    width: 30px;
    height: 1px;
    background: #475569;
    margin: 8px 0;
}

/* ==========================================================================
   Area Principal del Juego
   ========================================================================== */

.game-main-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.game-iframe-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    max-height: calc(100vh - 280px);
}

.game-iframe-wrapper iframe {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 280px);
    border: none;
}

/* Loading Spinner */
.game-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.game-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #334155;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.game-loading p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   Sidebar Derecho - Más Juegos
   ========================================================================== */

.game-sidebar-right {
    background: #0f172a;
    padding: 15px;
    border-left: 1px solid #334155;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.sidebar-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.sidebar-header h3 {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.sidebar-game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #1e293b;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-game-item:hover {
    background: #334155;
    transform: translateX(3px);
}

.sidebar-game-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-game-item .game-name {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Carrusel de Juegos Relacionados
   ========================================================================== */

.related-games-carousel {
    background: #0f172a;
    padding: 20px 25px;
    border-top: 1px solid #334155;
}

.carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.carousel-header h3 {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.carousel-nav {
    display: flex;
    gap: 8px;
}

.carousel-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: #3b82f6;
    color: #fff;
}

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

.carousel-wrapper {
    overflow: hidden;
    margin: 0 -5px;
}

.carousel-track {
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease;
    padding: 5px;
}

.carousel-game-item {
    flex: 0 0 120px;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
    transition: all 0.2s ease;
}

.carousel-game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.carousel-game-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.carousel-game-item .game-title {
    display: block;
    padding: 8px 10px;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Panel de Información del Juego
   ========================================================================== */

.game-info-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 25px 30px;
    border-top: 1px solid #334155;
}

.game-info-content {
    max-width: 1200px;
    margin: 0 auto;
}

.game-info-rating {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.game-info-rating .rating-positive,
.game-info-rating .rating-negative {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
}

.game-info-rating .rating-positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.game-info-rating .rating-negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.game-info-rating .icon {
    font-size: 18px;
}

.game-info-title {
    color: #f1f5f9;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.game-info-breadcrumb {
    margin-bottom: 15px;
    font-size: 13px;
}

.game-info-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.game-info-breadcrumb a:hover {
    text-decoration: underline;
}

.game-info-breadcrumb .sep {
    color: #64748b;
    margin: 0 8px;
}

.game-info-breadcrumb .current {
    color: #94a3b8;
}

.game-info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game-info-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background: #334155;
    color: #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.game-info-tags .tag:hover {
    background: #3b82f6;
    color: #fff;
}

.game-info-tags .tag-type {
    background: #7c3aed;
    color: #fff;
}

/* ==========================================================================
   Sección de Detalles del Juego
   ========================================================================== */

.game-details-section {
    background: #0f172a;
    padding: 40px 20px;
}

.game-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.detail-box {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px 25px;
    border: 1px solid #334155;
}

.detail-box h3 {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.detail-box .detail-content {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.7;
}

.detail-box .detail-content p {
    margin: 0 0 10px 0;
}

.detail-box .detail-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Juego No Disponible
   ========================================================================== */

.game-no-url {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.game-no-url h1 {
    color: #f1f5f9;
    font-size: 28px;
    margin-bottom: 15px;
}

.game-no-url p {
    color: #94a3b8;
    font-size: 16px;
}

/* ==========================================================================
   Fullscreen Mode
   ========================================================================== */

.game-player-layout.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    grid-template-columns: 60px 1fr 0;
}

.game-player-layout.fullscreen-mode .game-sidebar-right {
    display: none;
}

.game-player-layout.fullscreen-mode .game-iframe-wrapper {
    max-height: 100vh;
}

.game-player-layout.fullscreen-mode .game-iframe-wrapper iframe {
    max-height: 100vh;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .game-player-layout {
        grid-template-columns: 50px 1fr 180px;
    }

    .carousel-game-item {
        flex: 0 0 100px;
    }

    .carousel-game-item img {
        height: 75px;
    }
}

@media (max-width: 992px) {
    .game-player-layout {
        grid-template-columns: 50px 1fr;
    }

    .game-sidebar-right {
        display: none;
    }

    .game-info-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .game-player-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .game-sidebar-left {
        flex-direction: row;
        justify-content: center;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #334155;
        order: 2;
    }

    .sidebar-actions {
        flex-direction: row;
        position: static;
    }

    .action-separator {
        width: 1px;
        height: 30px;
        margin: 0 8px;
    }

    .game-main-area {
        padding: 10px;
        order: 1;
    }

    .game-iframe-wrapper {
        border-radius: 8px;
    }

    .game-iframe-wrapper,
    .game-iframe-wrapper iframe {
        max-height: 60vh;
    }

    .related-games-carousel {
        padding: 15px;
    }

    .carousel-game-item {
        flex: 0 0 90px;
    }

    .carousel-game-item img {
        height: 68px;
    }

    .carousel-game-item .game-title {
        font-size: 10px;
        padding: 6px 8px;
    }

    .game-info-panel {
        padding: 20px 15px;
    }

    .game-info-title {
        font-size: 20px;
    }

    .game-info-rating {
        flex-wrap: wrap;
        gap: 10px;
    }

    .game-info-rating .rating-positive,
    .game-info-rating .rating-negative {
        padding: 6px 12px;
        font-size: 14px;
    }

    .game-info-tags .tag {
        padding: 5px 10px;
        font-size: 11px;
    }

    .game-details-section {
        padding: 25px 15px;
    }

    .game-details-grid {
        grid-template-columns: 1fr;
    }

    .detail-box {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .action-btn {
        width: 38px;
        height: 38px;
    }

    .action-btn svg {
        width: 18px;
        height: 18px;
    }

    .action-btn .count {
        font-size: 9px;
    }

    .game-info-title {
        font-size: 18px;
    }

    .carousel-btn {
        width: 30px;
        height: 30px;
    }
}

/* ==========================================================================
   Share Modal
   ========================================================================== */

.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.share-modal-content h3 {
    color: #f1f5f9;
    font-size: 18px;
    margin: 0 0 20px 0;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.2s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook {
    background: #1877f2;
    color: #fff;
}

.share-btn.twitter {
    background: #1da1f2;
    color: #fff;
}

.share-btn.whatsapp {
    background: #25d366;
    color: #fff;
}

.share-btn.copy {
    background: #64748b;
    color: #fff;
}

.share-url-input {
    display: flex;
    gap: 10px;
}

.share-url-input input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 13px;
}

.share-url-input button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.share-url-input button:hover {
    background: #2563eb;
}

.share-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.game-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    opacity: 0;
    transition: all 0.4s ease;
}

.game-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.game-toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.game-toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.game-toast.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* ==========================================================================
   Banners Publicitarios en Página de Juego
   ========================================================================== */

.game-ad-banner {
    background: linear-gradient(135deg, #1e293b 0%, #162032 100%);
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.game-ad-below-player {
    /* Banner principal debajo del juego, entre carrusel y título */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    gap: 10px;
}

.game-ad-after-description {
    /* Banner después de la descripción del juego */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    margin-top: 10px;
    border-radius: 0 0 12px 12px;
}

/* Widget ads dentro de las áreas */
.widget-ad-game-below,
.widget-ad-game-desc {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.widget-ad-game-below img,
.widget-ad-game-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Etiqueta "Publicidad" sutil */
.game-ad-banner::before {
    content: '';
}

/* Banner en sidebar derecho del juego */
.sidebar-ad-slot {
    margin-top: 12px;
    padding: 8px;
    text-align: center;
    border-top: 1px solid #334155;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-ad-slot iframe {
    max-width: 100%;
    height: auto;
}

.sidebar-ad-slot img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Responsive: banners en móvil */
@media (max-width: 768px) {
    .game-ad-below-player {
        min-height: 60px;
        padding: 10px;
    }

    .game-ad-after-description {
        min-height: 80px;
        padding: 10px;
    }

    .sidebar-ad-slot {
        display: none; /* Ocultar ad sidebar en móvil */
    }
}
