/**
 * Pre-Game Video Ad System Styles 2
 * Save as: /themes/bricks/child/css/pregame-ad-system.css
 */

.pregame-facade-container {
    position: relative;
    display: block;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    height: auto;
}

.pregame-facade {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pregame-facade:hover .pregame-play-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.pregame-facade:hover .pregame-play-btn {
    transform: scale(1.05) skewX(-10deg);
}

.pregame-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pregame-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.pregame-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.pregame-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 18px;
    background: linear-gradient(135deg, #39a1ff, #005eff);
    color: #fff;
    border: 3px solid #000;
    border-radius: 8px;
    text-shadow: 1px 1px 0 #000;
    transform: skewX(-10deg);
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #222;
    cursor: pointer;
    min-width: auto;
    min-height: auto;
}

.pregame-play-btn:hover {
    background: linear-gradient(135deg, #ff944d, #ff003c);
    color: #fff;
    transform: scale(1.05) skewX(-10deg);
}

.pregame-play-icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin-left: 2px; /* Optical centering for play icon */
}

.pregame-play-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pregame-ad-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.pregame-ad-player {
    width: 100%;
    height: 100%;
    position: relative;
}

.pregame-ad-skip {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.pregame-skip-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pregame-skip-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.pregame-game-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.pregame-game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pregame-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 20;
}

.pregame-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: pregame-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes pregame-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pregame-loading p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pregame-facade-container {
        border-radius: 4px;
    }
    
    .pregame-play-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .pregame-play-icon {
        width: 18px;
        height: 18px;
    }
    
    .pregame-play-text {
        font-size: 16px;
    }
    
    .pregame-ad-skip {
        top: 10px;
        right: 10px;
    }
    
    .pregame-skip-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pregame-play-btn {
        padding: 8px 16px;
        font-size: 14px;
        gap: 6px;
    }
    
    .pregame-play-icon {
        width: 16px;
        height: 16px;
    }
    
    .pregame-play-text {
        font-size: 14px;
    }
}

/* Integration with Perfmatters lazy loading */
.has-pregame-facade .pregame-screenshot[data-lazy-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.has-pregame-facade .pregame-screenshot.lazy-loaded {
    opacity: 1;
}

/* Error states */
.pregame-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 20px;
    border: 2px dashed #dee2e6;
}

.pregame-error-message {
    font-size: 16px;
    margin: 0;
}

/* Ad player specific styles */
.pregame-ad-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Accessibility improvements */
.pregame-play-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

.pregame-skip-btn:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Animation for transitions */
.pregame-fade-in {
    animation: pregame-fade-in 0.5s ease-in-out;
}

@keyframes pregame-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Ad error styling */
.pregame-ad-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
}

.pregame-ad-error .pregame-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.pregame-ad-error h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #fff;
}

.pregame-ad-error p {
    margin: 0;
    font-size: 14px;
    color: #ccc;
}