/* ===== INTRO/MENU SECTION STYLES - SAFARI FIXED ===== */

#intro-section {
    background: #000;
    overflow: hidden;
}

/* ===== GLASSMORPHISM MENU OVERLAY WITH PARALLAX ===== */
.menu-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-width: calc(100vw - 40px);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    z-index: 1000;
    animation: menuFadeIn 1.2s ease-out 0.5s both;
    
    /* Enhanced for parallax */
    transition: transform 0.1s ease-out;
    will-change: transform;
    transform-style: preserve-3d;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9) translateY(20px);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }
}

/* ===== MENU TYPOGRAPHY ===== */
.menu-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.menu-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 32px;
    letter-spacing: 0.3px;
}

/* ===== MENU BUTTONS - SAFARI FIXED ===== */
.menu-buttons {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.menu-button {
    padding: 16px 24px;
    /* SAFARI FIX: Use semi-transparent dark background instead of white */
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    text-align: center;
    flex: 1;
    min-height: 60px;
    
    /* SAFARI FALLBACK: Add a solid dark background for browsers that don't support backdrop-filter */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Safari-specific styles */
@supports not (backdrop-filter: blur(15px)) {
    .menu-button {
        background: rgba(0, 0, 0, 0.4); /* Fallback for older browsers */
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Menu button content wrapper */
.menu-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

/* Menu button icons */
.menu-button-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 0.9; /* Increased opacity for better visibility */
    transition: all 0.3s ease;
}

.menu-button:hover .menu-button-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Menu button text */
.menu-button-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.95); /* Slightly more opaque */
}

/* Button number styling */
.button-number {
    position: absolute;
    top: 8px;
    left: 12px;
    color: rgba(255, 255, 255, 0.5); /* Slightly more visible */
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
}

/* Shimmer effect on hover - SAFARI OPTIMIZED */
.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.15), 
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.menu-button:hover::before {
    left: 100%;
}

.menu-button:hover {
    /* SAFARI FIX: Use darker hover state instead of white */
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 35px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Safari-specific hover fallback */
@supports not (backdrop-filter: blur(15px)) {
    .menu-button:hover {
        background: rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.6);
    }
}

.menu-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* ===== INFO BUTTON ===== */
.info-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    pointer-events: all;
    opacity: 1;
    animation: infoButtonFadeIn 1.5s ease-out 1s both;
}

@keyframes infoButtonFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.info-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.info-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.info-button:hover .info-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== INFO PANEL (APPEARS ABOVE BUTTON) ===== */
.info-panel {
    position: fixed;
    bottom: 90px;
    right: 30px;
    z-index: 1999;
    width: 320px;
    max-width: calc(100vw - 60px);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px); /* Safari support */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.info-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.info-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}

.info-panel-content {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Inline link styling */
.info-inline-link {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 2px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.info-inline-link:hover {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE MENU DESIGN ===== */
@media (max-width: 768px) {
    .menu-overlay {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 340px;
        max-width: calc(100vw - 40px);
        padding: 32px 28px;
        border-radius: 20px;
        margin: 0;
        
        /* Disable parallax on mobile for performance */
        transform-style: auto;
        will-change: auto;
        transform: translate(-50%, -50%) !important;
    }

    .menu-title {
        font-size: 44px;
        margin-bottom: 10px;
    }

    .menu-subtitle {
        font-size: 13px;
        margin-bottom: 28px;
    }

    .menu-buttons {
        flex-direction: column;
        gap: 14px;
    }

    .menu-button {
        padding: 16px 20px;
        font-size: 15px;
        border-radius: 12px;
        min-height: 70px;
        flex: none;
    }

    .menu-button-text {
        font-size: 15px;
    }

    .menu-button-icon {
        width: 26px;
        height: 26px;
    }

    .button-number {
        font-size: 10px;
        top: 10px;
        left: 14px;
    }

    /* Mobile info button */
    .info-button {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .info-icon {
        width: 18px;
        height: 18px;
    }

    /* Mobile info panel */
    .info-panel {
        bottom: 75px;
        right: 20px;
        left: 20px;
        width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .menu-overlay {
        width: 300px;
        max-width: calc(100vw - 30px);
        padding: 28px 24px;
        border-radius: 18px;
    }

    .menu-title {
        font-size: 38px;
        margin-bottom: 8px;
    }

    .menu-subtitle {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 24px;
    }

    .menu-button {
        padding: 14px 18px;
        font-size: 14px;
        border-radius: 10px;
        min-height: 65px;
    }

    .menu-button-text {
        font-size: 14px;
    }

    .menu-button-icon {
        width: 24px;
        height: 24px;
    }

    .button-number {
        font-size: 9px;
        top: 8px;
        left: 12px;
    }

    /* Small mobile info button */
    .info-button {
        bottom: 15px;
        right: 15px;
        width: 42px;
        height: 42px;
    }

    .info-icon {
        width: 16px;
        height: 16px;
    }

    /* Small mobile info panel */
    .info-panel {
        bottom: 65px;
        right: 15px;
        left: 15px;
        padding: 20px;
    }

    .info-panel-title {
        font-size: 15px;
    }

    .info-panel-content {
        font-size: 12px;
    }
}

/* ===== MENU ACCESSIBILITY ===== */
.menu-button:focus,
.info-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.menu-button:focus:not(:focus-visible),
.info-button:focus:not(:focus-visible) {
    outline: none;
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    .menu-overlay {
        animation: none;
        transform: translate(-50%, -50%) !important;
        transition: none;
        transform-style: auto;
        will-change: auto;
    }
    
    .info-button {
        animation: none;
    }
    
    .info-panel {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    .menu-button::before {
        transition: none;
    }
    
    .menu-button {
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }
}

/* ===== MENU CURSOR FIX ===== */
#intro-section,
#intro-section *,
.intro-viewer,
.intro-viewer * {
    cursor: default !important;
}

.intro-viewer:active {
    cursor: default !important;
}