@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Lexend:wght@400;700;900&display=swap");
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");

:root {
    --exit-primary: #ff3333;
    --exit-primary-glow: rgba(255, 51, 51, 0.4);
    --exit-bg: #030508;
    --exit-bg-elevated: #0a0a0f;
    --exit-text: #ffffff;
    --exit-text-muted: #606070;
    --exit-radius: 16px;
    --exit-gradient: linear-gradient(135deg, #ff3333 0%, #8b0000 100%);
    /* Arka plan: JPG/PNG/GIF/WebP hepsi çalışır. GIF animasyonlu oynar. */
    --exit-bg-image: url('https://i.imgur.com/4DMqDFY.jpeg');

    /* Mapping Legacy Variables for Tebex Compatibility */
    --color-primary: var(--exit-primary);
    --color-bg: var(--exit-bg);
    --color-text: var(--exit-text);
    --color-primary-text: #fff;
    --btn-size: 48px;
    --content-inner-width: 1400px;
}

/* 1. RESET & BASE */
*:not(i) {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Lexend', sans-serif;
}

html {
    background-color: #030508;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(255, 51, 51, 0.08) 0%, transparent 50%),
        var(--exit-bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-x: hidden;
    scroll-behavior: auto;
}

body {
    background: transparent;
    /* Show html background */
    color: var(--exit-text);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* 2. LAYOUT & ISKELET */
.exit-main {
    flex: 1;
    position: relative;
    z-index: 1;
    padding-top: calc(var(--exit-nav-h, 64px) + 28px);
}

.exit-main.ready {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.exit-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .exit-container {
        padding: 0 20px;
    }

    .exit-main {
        padding-top: 108px;
    }
}

.site-main-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.exit-site {
    position: relative;
    isolation: isolate;
}

/* Global ambient background (homepage enhanced in index.html) */
.exit-site-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.exit-site-bg__base {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 70% at 50% 0%, rgba(255, 51, 51, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(120, 30, 30, 0.15) 0%, transparent 55%),
        linear-gradient(180deg, #12080c 0%, #0a060a 40%, #060508 100%);
}

.exit-site-bg__texture {
    position: absolute;
    inset: 0;
    opacity: 0.55;
    background-image: var(--exit-bg-image);
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    mix-blend-mode: overlay;
}

.exit-site-bg__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform, opacity;
}

.exit-site-bg__glow--hero {
    top: -5%;
    left: 50%;
    width: min(1000px, 110vw);
    height: min(700px, 80vh);
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 51, 51, 0.5) 0%, rgba(255, 80, 40, 0.2) 35%, transparent 68%);
    animation: exitBgPulse 8s ease-in-out infinite alternate;
}

.exit-site-bg__glow--accent {
    bottom: 15%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 51, 51, 0.08) 0%, transparent 70%);
    opacity: 0.6;
}

.exit-site-bg__grid {
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
}

.exit-site-bg__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 95% 85% at 50% 35%, transparent 0%, rgba(6, 4, 8, 0.25) 65%, rgba(4, 3, 6, 0.55) 100%);
}

.exit-site-bg__fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 70%,
        rgba(6, 4, 8, 0.15) 88%,
        rgba(4, 3, 6, 0.3) 100%);
}

@keyframes exitBgPulse {
    0% { opacity: 0.75; transform: translateX(-50%) scale(1); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

html:has(body.page-home) {
    background-color: #0a0608;
    background-image:
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 51, 51, 0.18) 0%, transparent 55%),
        var(--exit-bg-image);
    background-size: cover;
    background-position: center 15%;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body.page-home {
    background: transparent !important;
}

/* 3. PRODUCT GRID */
.store-products-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* 3. MODERN GLASS CARDS (GLOBAL) */
.glass-card,
.store-product,
.exit-package-card {
    background: rgba(6, 6, 10, 0.6) !important;
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: var(--exit-radius);
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.glass-card:hover,
.store-product:hover,
.exit-package-card:hover {
    background: rgba(10, 10, 15, 0.8) !important;
    transform: translateY(-8px);
    border-color: rgba(255, 71, 87, 0.3) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.store-product .product-title {
    font-size: 1.2rem;
    font-weight: 800;
}

/* GLOBAL PACKAGE IMAGE STABILIZER */
.card-media,
.image-link,
.store-product .image-link,
.product-image-container {
    background-color: #000 !important;
    background-image: none !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px;
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.product-image,
.store-product .image,
.slide-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: none !important;
    /* No more magnifying zoom */
    transition: 0.3s ease !important;
}

.exit-package-card:hover .product-image,
.store-product:hover .image {
    transform: none !important;
    /* Force static stability */
}

.store-product .price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--exit-primary);
}

/* 4. TRUE GLASS BUTTONS (GLOBAL) */
.btn-primary,
.btn-package,
.btn-add-to-cart,
button[type="submit"],
.btn-basket {
    background: rgba(255, 255, 255, 0.03) !important;
    background-image: none !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    color: #fff !important;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 100%;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover,
.btn-package:hover,
.btn-add-to-cart:hover,
button[type="submit"]:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 71, 87, 0.1) !important;
    border-color: rgba(255, 71, 87, 0.4) !important;
    box-shadow: 0 15px 40px rgba(255, 71, 87, 0.2) !important;
}

/* 5. CATEGORY & PACKAGES */
.category-header {
    margin-bottom: 40px;
}

.category-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
}

/* 6. BASKET & POPUPS - ESSENTIAL */
.popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-content {
    background: rgba(13, 13, 18, 0.5) !important;
    backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8);
}

/* 7. TOASTS */
.toaster {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--exit-bg-elevated);
    border-left: 4px solid var(--exit-primary);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}

.toast-close:hover {
    background: var(--exit-primary);
}

/* 8. FOOTER */
.site-footer {
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.01) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
    position: relative;
    z-index: 10;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    gap: 30px;
    list-style: none;
    margin-bottom: 20px;
}

/* 9. MEDIA SLIDER (PACKAGE PAGE) */
.media-slider {
    width: 100%;
    margin-bottom: 30px;
}

.media-slider .slide-image {
    border-radius: 16px;
    width: 100%;
}

.media-slider .thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.media-slider .thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.media-slider .thumb.active {
    border-color: var(--exit-primary);
}

/* REDUNDANT BUYCRAFT OVERRIDES */
.sidebar,
.module,
.featured-package {
    display: none !important;
}

/* 9. GIFT FORM & INPUTS */
.gift-form-popup .popup-content {
    max-width: 550px;
    padding: 50px;
}

.gift-form-popup h2 {
    font-size: 1.8rem;
    font-weight: 1000;
    margin-bottom: 10px;
    text-align: center;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gift-form-popup .sub-header {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 35px;
    line-height: 1.5;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px;
    padding: 18px 24px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    transition: 0.4s;
    margin-bottom: 25px;
    outline: none;
    text-align: center;
}


.form-control:focus {
    border-color: var(--exit-primary) !important;
    background: rgba(255, 71, 87, 0.05) !important;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.1);
}

.gift-form-popup .actions {
    margin-top: 10px;
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    transition: 0.3s;
}

.popup-close:hover {
    background: var(--exit-primary);
    color: #fff;
}

/* 10. GIFT BUTTON GLOBAL */
.gift {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 12px 20px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    margin-top: 10px !important;
    width: 100% !important;
}

.gift i {
    color: var(--exit-primary) !important;
    font-size: 1rem !important;
    filter: drop-shadow(0 0 5px var(--exit-primary-glow));
}

.gift:hover {
    background: rgba(255, 71, 87, 0.08) !important;
    border-color: rgba(255, 71, 87, 0.4) !important;
    color: #fff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
}

.gift:active {
    transform: translateY(-1px) !important;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--exit-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--exit-primary);
    border-radius: 10px;
}


/* ============================================================
   ?? MOBILE PERFORMANCE & STABILITY OPTIMIZATION
   Fixes the 'A problem repeatedly occurred' crash on iOS Safari
   ============================================================ */
@media (max-width: 1024px) {

    /* 1. Disable Fixed Backgrounds (Extreme performance killer on mobile) */
    html {
        background-attachment: scroll !important;
        background-image: var(--exit-bg-image) !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }

    html:has(body.page-home) {
        background-attachment: scroll !important;
        background-image:
            radial-gradient(ellipse 90% 50% at 50% 0%, rgba(255, 51, 51, 0.15) 0%, transparent 55%),
            var(--exit-bg-image) !important;
        background-size: cover !important;
        background-position: center 15% !important;
    }

    .exit-site-bg__glow--hero {
        animation: none !important;
        filter: blur(40px);
    }

    .exit-site-bg__texture {
        opacity: 0.4 !important;
        mix-blend-mode: overlay !important;
    }

    /* 2. Reduce/Disable Backdrop-Filter (Process crash culprit) */
    .glass-card,
    .store-product,
    .exit-package-card,
    .btn-primary,
    .btn-package,
    .btn-add-to-cart,
    button[type='submit'],
    .btn-basket,
    .popup-content,
    .site-footer,
    .gift,
    .currency-trigger,
    .basket-square-btn,
    .player-profile-capsule,
    .login-trigger-btn,
    .hero-stats,
    .faq-card,
    .feature-card,
    .exit-btn-primary,
    .exit-btn-secondary,
    .controls-inner,
    .sort-menu,
    .capsule-navbar {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(20, 20, 25, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    /* 3. Optimize Animations & Transitions */
    .exit-package-card:hover,
    .store-product:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* 4. Heavy Shadow Removal */
    * {
        text-shadow: none !important;
        box-shadow: none !important;
    }

    .btn-primary,
    .btn-package,
    .btn-add-to-cart {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    }

    /* 5. Disable heavy background animations */
    .hero-grid-pattern,
    .hero-ambient-glow,
    .exit-hero-backdrop,
    .exit-site-bg__glow--hero {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .exit-site-bg__glow--hero {
        animation: none;
    }
}