/* Global Reset */
* {
    box-sizing: border-box;
}

:root {
    --primary-gold: #d4af37;
    --glass-bg: rgba(20, 30, 40, 0.85);
    /* Slightly darker for readability */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #e0e0e0;
    --error-red: #ff4d4d;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: var(--text-main);
    font-family: 'Lato', sans-serif;
}

/* --- Background Layers --- */
#cinematic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at center, #1e2a3a 0%, #0b1118 100%);
    z-index: 0;
}

#cinematic-bg::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0px, rgba(0, 0, 0, 0.05) 1px, transparent 1px, transparent 4px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 4px);
    opacity: 0.8;
    z-index: 0;
    mix-blend-mode: overlay;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1; /* Above bg, below light ray */
    pointer-events: none;
    mix-blend-mode: screen;
}

#light-ray {
    position: fixed;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100vh;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(169, 169, 169, 0.1) 30%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(169, 169, 169, 0.1) 70%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    z-index: 1;
    animation: lightPass 15s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
    /* Slow loop */
    pointer-events: none;
    mix-blend-mode: overlay;
}

@keyframes lightPass {
    0% {
        left: -100%;
        opacity: 0;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

#vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}


/* Header Element Styles */
#header-logo {
    position: absolute;
    top: 50px;
    /* Center anchor */
    left: 30px;
    height: 60px;
    /* Slightly larger than text */
    width: auto;
    transform: translateY(-50%);
    /* Center vertically */
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease-out;
    margin: 0;
    /* Critical: Remove default margins */
}

/* --- Intro / Header Title --- */
#brand-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    /* Critical: Remove browser default margins */

    font-family: 'Cinzel Decorative', cursive;

    /* User wants 4rem intro, 2.5rem final. */
    font-size: 4rem;

    letter-spacing: 5px;
    z-index: 10;
    white-space: nowrap;
    /* Prevent wrapping */

    /* Text Styling - SILVER METALLIC (Live Site styling) */
    background: linear-gradient(to bottom, #f0f0f0 0%, #a0a0a0 50%, #606060 51%, #a0a0a0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));

    /* Animation */
    opacity: 0;
    animation: introFadeIn 1s ease-out forwards 0s;
    transition: all 1s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes introFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(28px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}


.highlight-i {
    background: linear-gradient(to bottom, #ff4d4d 0%, #cc0000 50%, #800000 51%, #cc0000 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 #4b0000) drop-shadow(0 0 10px rgba(128, 0, 0, 0.8));
    font-style: normal;
    font-family: 'Cinzel Decorative', cursive;
}

/* --- Utility Classes for Transition --- */
.brand-positioned {
    /* Final position: Top Left, next to logo */
    top: 50px !important;
    /* Center vertically relative to logo height roughly */
    left: 95px !important;
    /* Logo (30px) + Width (~55px) + Gap (10px) */
    transform: translate(0, -50%) !important;
    /* Center horizontally removed, keep vertical center */
    font-size: 2.5rem !important;
    /* Scale down */
}

/* --- Auth UI Styles --- */
#auth-container {
    position: absolute;
    top: 50px;
    right: 40px;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    justify-content: flex-end;
}

.login-link,
.account-menu {
    color: var(--text-main);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(20, 30, 40, 0.5);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInLink 1s ease forwards 2s;
    /* Fades in after main intro */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.account-menu {
    padding: 4px 16px 4px 4px;
    /* Less padding on left for avatar */
    border-radius: 30px;
    /* Pill shape */
}

/* Sync Inbox icon fade-in with account menu on landing page */
.messaging-icon-btn {
    opacity: 0;
    animation: fadeInLink 1s ease forwards 2s;
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--primary-gold);
    object-fit: cover;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    background: rgba(10, 15, 20, 0.95);
    min-width: 160px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 30;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.dropdown-content a {
    color: #ccc;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.account-menu-wrapper {
    position: relative;
    padding-bottom: 15px;
    /* Creates an invisible hit-area bridge to the dropdown */
}

/* Note: reset the top/right on account-menu itself since wrapper holds it */
.account-menu-wrapper .account-menu {
    position: relative;
    top: 0;
    right: 0;
}

.account-menu-wrapper:hover .dropdown-content {
    display: block;
}

@keyframes fadeInLink {
    to {
        opacity: 1;
    }
}

.login-link:hover,
.account-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (max-width: 768px) {
    #brand-title {
        font-size: 2.5rem;
        /* Smaller intro size */
    }

    .brand-positioned {
        left: 70px !important;
        /* Closer to logo */
        font-size: 1.5rem !important;
        /* Smaller final size */
    }

    #header-logo {
        left: 15px;
        /* Adjust logo position if needed */
        height: 50px;
        /* Slightly smaller logo */
    }

    #auth-container {
        top: 50px;
        right: 20px;
    }

    .login-link {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* --- VIDEO CAROUSEL --- */
#video-carousel-container {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    z-index: 15;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    animation: carouselFadeIn 1.5s ease forwards 1.5s; /* Delays appearance */
}

@keyframes carouselFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#carousel-scene {
    position: relative;
    width: 60%;
    max-width: 600px;
    aspect-ratio: 16 / 9;
    perspective: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transform-style: preserve-3d;
}

.carousel-item iframe {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    pointer-events: none; /* Disable interaction until active */
}

/* Active center item */
.carousel-item.active {
    opacity: 1;
    transform: translateX(0) scale(1) translateZ(0) rotateY(0);
    z-index: 10;
    pointer-events: auto;
}
.carousel-item.active iframe {
    pointer-events: auto;
}
.carousel-item.active .carousel-overlay {
    background: rgba(0,0,0,0);
    pointer-events: none;
}

/* Left item */
.carousel-item.prev {
    opacity: 0.6;
    transform: translateX(-50%) scale(0.8) translateZ(-200px) rotateY(35deg);
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
}

/* Right item */
.carousel-item.next {
    opacity: 0.6;
    transform: translateX(50%) scale(0.8) translateZ(-200px) rotateY(-35deg);
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
}

/* Hidden items */
.carousel-item.hidden-item {
    opacity: 0;
    transform: translateX(0) scale(0.5) translateZ(-500px);
    z-index: 1;
}

.carousel-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 12px;
    background: rgba(0,0,0,0.5);
    transition: background 0.6s ease;
}

.carousel-item.prev:hover .carousel-overlay,
.carousel-item.next:hover .carousel-overlay {
    background: rgba(0,0,0,0.2);
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--primary-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: var(--primary-gold);
    color: #000;
    box-shadow: 0 0 15px var(--primary-gold);
}

#carousel-dots {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

#carousel-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.5);
}

#carousel-dots .dot.active,
#carousel-dots .dot:hover {
    background: var(--primary-gold);
    box-shadow: 0 0 8px var(--primary-gold);
}

@media (max-width: 768px) {
    #video-carousel-container {
        width: 95%;
        top: 60%;
        padding: 8px;
        gap: 5px;
    }
    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    #carousel-scene {
        width: 80%;
    }
    .carousel-item.prev {
        transform: translateX(-35%) scale(0.8) translateZ(-150px) rotateY(25deg);
    }
    .carousel-item.next {
        transform: translateX(35%) scale(0.8) translateZ(-150px) rotateY(-25deg);
    }
}
