/* Inline 3D Gallery Styles */
.inline-gallery {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.theme-inverted .inline-gallery {
    background: rgba(0, 0, 0, 0.1);
}

.gallery-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

body.theme-inverted .gallery-close {
    background: #fff;
    color: #000;
}

#gallery-stack {
    width: 100%;
    height: 100%;
}

/* 3D Stacked Items CSS */
.stack-item {
    position: absolute;
    width: 400px;
    height: 500px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .stack-item {
        width: 80vw;
        height: 60vh;
    }
}

/* Loading State */
@media (scripting: enabled) {
    .loading::before,
    .loading::after {
        content: "";
        position: fixed;
        z-index: 10000;
    }

    .loading::before {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-primary);
    }

    .loading::after {
        top: 50%;
        left: 50%;
        width: 100px;
        height: 1px;
        margin: 0 0 0 -50px;
        background: var(--text-primary);
        animation: loaderAnim 1.5s ease-in-out infinite alternate forwards;
    }
}

@keyframes loaderAnim {
    0% { transform: scaleX(0); transform-origin: 0% 50%; }
    50% { transform: scaleX(1); transform-origin: 0% 50%; }
    50.1% { transform: scaleX(1); transform-origin: 100% 50%; }
    100% { transform: scaleX(0); transform-origin: 100% 50%; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 20px;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.theme-inverted .modal {
    background: rgba(0, 0, 0, 0.95);
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 900px;
    padding: 60px;
    position: relative;
    border: 1px solid var(--border);
    margin: auto;
    flex-shrink: 0;
}

body.theme-inverted .modal-content {
    background: #0a0a0a;
    color: #fff;
    border-color: #333333;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    color: inherit;
}

.modal-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
    text-transform: uppercase;
}

.registration-grid {
    display: grid;
    grid-template-cols: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.reg-card {
    border: 1px solid var(--border);
    padding: 30px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.reg-card:hover {
    background: var(--text-primary);
    color: #fff;
}

body.theme-inverted .reg-card:hover {
    background: #fff;
    color: #000;
}

.reg-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.reg-card p {
    font-size: 14px;
    color: inherit;
    opacity: 0.7;
}

/* Sponsors */
.sponsors {
    padding: 100px 0;
    text-align: center;
    background-color: var(--bg-primary);
}

.section-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 60px;
    text-transform: uppercase;
}

.sponsor-tier {
    margin-bottom: 80px;
}

.sponsor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 40px;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
    width: 120px; /* Fixed container width */
    height: 60px; /* Fixed container height */
}

.sponsor-logo:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.sponsor-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sponsor-logo.large {
    width: 200px;
    height: 100px;
}

.sponsor-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

/* Countdown */
.countdown-timer {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #000;
    color: #fff;
    padding: 15px 25px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 4px;
}

body.theme-inverted .countdown-timer {
    background: #fff;
    color: #000;
}

.countdown-content {
    display: flex;
    flex-direction: column;
}

.countdown-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.countdown-time {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.countdown-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

/* Footer */
.footer {
    padding: 80px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.copyright {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sponsor-logo {
        margin: 15px 20px;
    }
    .sponsor-logo img {
        max-height: 30px;
    }
    .sponsor-logo.large img {
        max-height: 60px;
    }
    .countdown-timer {
        bottom: 20px;
        right: 20px;
        left: 20px;
        justify-content: center;
    }
}
