/**
 * StatsBet Popup Base Styles
 *
 * Shared CSS variables and base styles for all popup modals.
 * This ensures consistency across search, auth, and future popups.
 */

/* ==========================================================================
   Shared CSS Variables
   ========================================================================== */

:root {
    /* Colors - matching slide menu */
    --statsbet-popup-bg: #1a1a2e;
    --statsbet-popup-text: #ffffff;
    --statsbet-popup-text-muted: #a0a0a0;
    --statsbet-popup-overlay: rgba(0, 0, 0, 0.5);
    --statsbet-popup-accent: #FFCC00;
    --statsbet-popup-hover-bg: rgba(255, 255, 255, 0.1);
    --statsbet-popup-border: rgba(255, 255, 255, 0.1);

    /* Animation */
    --statsbet-popup-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index hierarchy */
    --statsbet-popup-z-overlay: 9999;
    --statsbet-popup-z-content: 10000;
}

/* ==========================================================================
   Base Overlay Styles
   ========================================================================== */

.statsbet-popup-overlay,
.statsbet-search-popup-overlay,
.statsbet-auth-popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--statsbet-popup-overlay);
    opacity: 0;
    visibility: hidden;
    z-index: var(--statsbet-popup-z-overlay);
    transition: opacity var(--statsbet-popup-transition),
                visibility var(--statsbet-popup-transition);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.statsbet-popup-overlay.is-active,
.statsbet-search-popup-overlay.is-active,
.statsbet-auth-popup-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Base Popup Container
   ========================================================================== */

.statsbet-popup,
.statsbet-search-popup,
.statsbet-auth-popup {
    position: fixed;
    inset: 0;
    z-index: var(--statsbet-popup-z-content);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    padding-top: 60px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--statsbet-popup-transition),
                visibility var(--statsbet-popup-transition);
}

.statsbet-popup.is-active,
.statsbet-search-popup.is-active,
.statsbet-auth-popup.is-active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when any popup is open */
body.statsbet-popup-open,
body.statsbet-search-popup-open,
body.statsbet-auth-popup-open {
    overflow: hidden;
}

/* ==========================================================================
   Base Inner Container
   ========================================================================== */

.statsbet-popup__container,
.statsbet-search-popup__container,
.statsbet-auth-popup__container {
    position: relative;
    width: 100%;
    background: var(--statsbet-popup-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px);
    transition: transform var(--statsbet-popup-transition);
}

.statsbet-popup.is-active .statsbet-popup__container,
.statsbet-search-popup.is-active .statsbet-search-popup__container,
.statsbet-auth-popup.is-active .statsbet-auth-popup__container {
    transform: translateY(0);
}

/* ==========================================================================
   Base Close Button (matching slide menu style)
   ========================================================================== */

.statsbet-popup__close,
.statsbet-search-popup__close,
.statsbet-auth-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--statsbet-popup-text-muted);
    cursor: pointer;
    transition: background var(--statsbet-popup-transition),
                color var(--statsbet-popup-transition);
    z-index: 2;
}

.statsbet-popup__close:hover,
.statsbet-search-popup__close:hover,
.statsbet-auth-popup__close:hover {
    background: var(--statsbet-popup-hover-bg);
    color: var(--statsbet-popup-text);
}

.statsbet-popup__close:focus,
.statsbet-search-popup__close:focus,
.statsbet-auth-popup__close:focus {
    outline: 2px solid var(--statsbet-popup-accent);
    outline-offset: 2px;
}

.statsbet-popup__close svg,
.statsbet-search-popup__close svg,
.statsbet-auth-popup__close svg {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   Base Content Area
   ========================================================================== */

.statsbet-popup__content,
.statsbet-search-popup__content,
.statsbet-auth-popup__content {
    padding: 20px;
    padding-top: 60px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Responsive - Mobile
   ========================================================================== */

@media screen and (max-width: 767px) {
    .statsbet-popup,
    .statsbet-search-popup,
    .statsbet-auth-popup {
        padding: 10px;
        padding-top: 20px;
    }

    .statsbet-popup__container,
    .statsbet-search-popup__container,
    .statsbet-auth-popup__container {
        border-radius: 10px;
        max-height: calc(100vh - 40px);
    }

    .statsbet-popup__content,
    .statsbet-search-popup__content,
    .statsbet-auth-popup__content {
        padding: 16px;
        padding-top: 56px;
        max-height: calc(100vh - 80px);
    }

    .statsbet-popup__close,
    .statsbet-search-popup__close,
    .statsbet-auth-popup__close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .statsbet-popup__close svg,
    .statsbet-search-popup__close svg,
    .statsbet-auth-popup__close svg {
        width: 20px;
        height: 20px;
    }
}

/* ==========================================================================
   Responsive - Tablet
   ========================================================================== */

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .statsbet-popup,
    .statsbet-search-popup,
    .statsbet-auth-popup {
        padding-top: 80px;
    }
}

/* ==========================================================================
   Responsive - Desktop
   ========================================================================== */

@media screen and (min-width: 1024px) {
    .statsbet-popup,
    .statsbet-search-popup,
    .statsbet-auth-popup {
        padding-top: 100px;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .statsbet-popup,
    .statsbet-popup-overlay,
    .statsbet-popup__container,
    .statsbet-popup__close,
    .statsbet-search-popup,
    .statsbet-search-popup-overlay,
    .statsbet-search-popup__container,
    .statsbet-search-popup__close,
    .statsbet-auth-popup,
    .statsbet-auth-popup-overlay,
    .statsbet-auth-popup__container,
    .statsbet-auth-popup__close {
        transition: none;
    }
}

/* ==========================================================================
   Print - Hide popups
   ========================================================================== */

@media print {
    .statsbet-popup,
    .statsbet-popup-overlay,
    .statsbet-search-popup,
    .statsbet-search-popup-overlay,
    .statsbet-auth-popup,
    .statsbet-auth-popup-overlay {
        display: none !important;
    }
}
