/**
 * Frontend CSS for Welcome Ad Modal
 * Responsive design with 800x600 max size on desktop
 */

/* Modal Overlay */
.welcome-ad-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.welcome-ad-modal.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Backdrop */
.welcome-ad-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

/* Modal Container */
.welcome-ad-container {
    position: relative;
    max-width: 800px;
    max-height: 600px;
    width: 90%;
    height: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.welcome-ad-modal.show .welcome-ad-container {
    transform: scale(1);
}

/* Close Button */
.welcome-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.welcome-ad-close:hover,
.welcome-ad-close:focus {
    background: rgba(0, 0, 0, 0.9);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Ad Content */
.welcome-ad-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ad Image */
.welcome-ad-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 8px;
}

.welcome-ad-image:hover,
.welcome-ad-image:focus {
    transform: scale(1.02);
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Countdown */
.welcome-ad-countdown {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10;
}

.countdown-seconds {
    font-weight: bold;
    color: #ff6b6b;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .welcome-ad-container {
        max-width: 700px;
        max-height: 525px;
        width: 85%;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .welcome-ad-container {
        max-width: 95%;
        max-height: 80vh;
        width: 95%;
        margin: 10px;
    }
    
    .welcome-ad-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .welcome-ad-countdown {
        bottom: 5px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .welcome-ad-modal {
        padding: 10px;
    }
    
    .welcome-ad-container {
        width: 100%;
        max-height: 70vh;
        border-radius: 6px;
    }
    
    .welcome-ad-image {
        border-radius: 6px;
    }
    
    .welcome-ad-countdown {
        font-size: 10px;
        padding: 5px 10px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .welcome-ad-modal,
    .welcome-ad-container,
    .welcome-ad-image,
    .welcome-ad-close {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .welcome-ad-backdrop {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .welcome-ad-close {
        background: #000;
        border: 2px solid #fff;
    }
    
    .welcome-ad-countdown {
        background: #000;
        border: 1px solid #fff;
    }
}

/* Focus Visible for Better Accessibility */
.welcome-ad-close:focus-visible,
.welcome-ad-image:focus-visible,
.welcome-ad-backdrop:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading State (if needed) */
.welcome-ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
}

/* Print Styles - Hide modal when printing */
@media print {
    .welcome-ad-modal {
        display: none !important;
    }
}