/* ==================================== */
/* 1. GLOBAL & SLIDE STRUCTURE */
/* ==================================== */

.slide-transition {
    /* Custom cubic-bezier for a smooth, high-quality feel */
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.4, 1);
}

body,
html {
    height: 100%;
    margin: 0;
    /* Prevents the browser's default scrollbar, crucial for scroll-jacking */
    overflow: hidden;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    background-color: #111827;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    color: white;
}

/* Slide Stacking Order */
#slide-1 {
    z-index: 10;
}

#slide-2 {
    z-index: 20;
}

#slide-3 {
    z-index: 30;
}

#slide-4 {
    z-index: 40;
    overflow-y: auto;
}

#slide-5 {
    z-index: 50;
}

#slide-6 {
    z-index: 60;
}

/* Scrollbar styling for Slide 2 (for inner scroll content) */
/* Hiding Default Scrollbar for all slides to prevent overlap with custom scrollbar */
#slide-1,
#slide-2,
#slide-3,
#slide-4,
#slide-5,
#slide-6 {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#slide-1::-webkit-scrollbar,
#slide-2::-webkit-scrollbar,
#slide-3::-webkit-scrollbar,
#slide-4::-webkit-scrollbar,
#slide-5::-webkit-scrollbar,
#slide-6::-webkit-scrollbar {
    display: none;
}

.slide-up-transition {
    transition: transform 0.7s ease-in-out, opacity 0.7s ease-in-out;
}

.star {
    will-change: transform, z-index;
    transition: transform 0.15s ease-out, opacity 0.7s ease-in-out;
    opacity: 0;
    transform: scale(0);
}

.button-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.translate-y-full {
    transform: translateY(100%);
}

/* ==================================== */
/* 2. MARQUEE STYLES (SLIDE 2 & 3) - REVISED FOR SEAMLESS LOOP */
/* ==================================== */

/* CORRECTED Animation Keyframes for seamless loop (0% to -100%) */
@keyframes scroll-left {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }

    /* Scrolls the full width of duplicated content */
}

@keyframes scroll-right {
    0% {
        transform: translate3d(-100%, 0, 0);
    }

    /* Starts off-screen left */
    100% {
        transform: translate3d(0, 0, 0);
    }

    /* Ends at original position */
}

/* Reduced Speed: Increased duration to 100s for a slower scroll */
.animate-scroll-left {
    animation: scroll-left 100s linear infinite;
}

.animate-scroll-right {
    animation: scroll-right 100s linear infinite;
}

.marquee-container {
    white-space: nowrap;
    display: flex;
    align-items: center;
    width: fit-content;
    /* 🚩 FIXED: Reverting to 200% (assuming content is duplicated in HTML) 
       or using fit-content with an explicit display: flex/inline-flex on content */
    min-width: 200%;
}

/* Marquee text styling for Slide 2 */
#slide-2 .marquee-container span {
    font-size: 2rem;
    font-weight: 800;
    padding: 0 1.5rem;
    /* Ensure content on Slide 2 is inline-block as well */
    display: inline-block;
}

/* Marquee text styling for Slide 3 */
.marquee-text {
    font-size: 5rem;
    line-height: 1.5;
    font-weight: 900;
    padding: 0 2rem;
    color: #d8fb4c;
    -webkit-text-stroke: 2px #d8fb4c;
    letter-spacing: 0.1em;
    user-select: none;
    /* 🚩 FIXED: Ensures the text span is treated as a block for accurate width calculation */
    display: inline-block;
    box-sizing: content-box;
}

.marquee-filled .marquee-text {
    color: #d8fb4c;
    -webkit-text-stroke: 0;
}

/* Logo icon styling for Slide 2 marquee */
.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 16px;
    background-color: transparent;
}

.logo-image {
    width: 100%;
    height: 100%;
    background-image: url('images/blacklogo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
}

/* ==================================== */
/* 3. SLIDE 3: 3D FLIP CARD & Z-INDEX FIX */
/* ==================================== */

/* FIX: Ensure the looping text is visible behind the image */
#looping-text-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    /* Adjusted to space-evenly for consistent gaps */
    /* Sets text *behind* the image container */
    z-index: 39;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    /* Ensuring the correct font is applied */
}

#zoom-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Note: The final width/height is controlled by Tailwind classes in HTML */
    transform: translate(-50%, -50%);
    z-index: 40;
    /* Image sits *on top* of the text */
    pointer-events: none;
    /* Key for 3D: Sets the depth perception */
    perspective: 1500px;
    /* Add transform-origin to ensure rotation happens around the center point */
    transform-origin: 50% 50%;
}

#zoom-image-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    /* Key for 3D: Allows children to exist in 3D space */
    transform-style: preserve-3d;
    /* The JS will apply the `translateX` and `rotateY` transforms here */
    transition: transform 1s ease-in-out;
}

.flip-face {
    position: absolute;
    width: 100%;
    height: 100%;
    /* Allow Tailwind classes like object-cover to rule freely */

    /* Key for 3D: Hides the back side of the face when turned away */
    backface-visibility: hidden;
}

.flip-face-front {
    transform: rotateY(0deg);
}

.flip-face-back {
    /* Back face starts flipped 180 degrees so it faces forward when the flipper rotates 180 */
    transform: rotateY(180deg);
}

/* ==================================== */
/* 4. POST-FLIP IMAGE AND TEXT ANIMATION */
/* ==================================== */

.image-final-position {
    /* Class now used purely as a javascript logic flag for flip state */
    z-index: 40;
}

/* Initial state and transition for the works column (NO CHANGE HERE) */
#works-list-column {
    transform: translateX(-100px);
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.4, 1), opacity 0.5s ease-out;
}

/* Final state class for the works column (NO CHANGE HERE) */
.works-slide-in {
    transform: translateX(0px) !important;
    opacity: 1 !important;
}

/* --- Marquee Text Styling & Containers (Cleanup) --- */
.overflow-hidden {
    overflow: hidden;
    white-space: nowrap;
}

/* ==================================== */
/* 5. NEW STYLES: TOOLBAR & BUTTONS     */
/* ==================================== */

/* Toolbar Opacity & Hover */
#main-toolbar {
    opacity: 0.5;
    /* Combine transitions to preserve the slide-down effect while allowing opacity change */
    transition: opacity 0.3s ease-in-out, transform 0.7s ease-out;
}

#main-toolbar:hover {
    opacity: 1;
}

/* Pulsate Animation */
@keyframes pulse-scale {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(199, 249, 8, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(199, 249, 8, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(199, 249, 8, 0);
    }
}

.pulsate {
    animation: pulse-scale 2s infinite;
}

/* Login Button Styling */
.login-btn {
    background-color: white !important;
    color: #0C1AC1 !important;
    font-size: 0.825rem !important;
    /* Smaller text */
    padding: 0.5rem 1.5rem !important;
    /* Smaller padding */
    border-radius: 9999px;
    font-weight: 700 !important;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.login-btn:hover {
    background-color: #c7f908 !important;
    color: #0C1AC1 !important;
    border-color: #c7f908 !important;
}

/* ==================================== */
/* 5. THUMBNAIL GALLERY STYLES */
/* ==================================== */

#thumbnail-gallery {
    position: absolute;
    bottom: 3rem;
    left: 36%;
    opacity: 0;
    transition: opacity 1.2s ease-out;
    z-index: 50;
}

#thumbnail-gallery.gallery-visible {
    opacity: 1;
}

#thumbnail-gallery .gallery-inner {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
}

.gallery-thumb {
    width: 8rem;
    height: 6rem;
    object-fit: contain;
    background-color: #111827;
    /* gray-900 */
    border: 2px solid #374151;
    /* gray-700 */
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;

    /* Animation State: Initial */
    transform: scale(0);
}

.gallery-thumb:hover {
    border-color: #c7f908;
    /* If visible, scale up. If not visible (scale 0), hover shouldn't trigger, but pointer-events handle that usually. */
}

/* Visible State (Popped In) */
.gallery-thumb.thumb-visible {
    transform: scale(1);
}

.gallery-thumb.thumb-visible:hover {
    transform: scale(1.1);
}

/* Policy Buttons Styling */
.policy-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 3.5rem;
    justify-content: center;
}

.policy-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid rgba(14, 14, 14, 0.3);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0E0E0E;
    text-decoration: none !important;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.policy-btn:hover {
    background: #0C1AC1;
    color: white !important;
    border-color: #0C1AC1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12, 26, 193, 0.2);
}

/* Discord-Style Footer */
.discord-footer {
    background: linear-gradient(135deg, #8ea500 0%, #cafe00 100%);
    color: #000000;
    padding: 80px 40px;
    font-family: 'Outfit', sans-serif;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-contact {
    color: #000000;
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.contact-item a {
    color: #000000;
    text-decoration: none;
    font-weight: 700;
}

.contact-item i {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.footer-column h4 {
    color: #000000;
    text-transform: uppercase;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: #000000;
    text-decoration: none;
    font-size: 1rem;
    transition: text-decoration 0.2s;
    opacity: 0.8;
}

.footer-column ul li a:hover {
    text-decoration: underline;
    opacity: 1;
}

.footer-brand-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-logo img {
    height: 48px;
    /* Increased size for logo */
}

.footer-lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    color: #000000;
}

.footer-socials {
    display: flex;
    gap: 24px;
    font-size: 1.5rem;
}

.footer-socials a {
    color: #000000;
    transition: transform 0.2s;
}

.footer-socials a:hover {
    transform: translateY(-3px);
}

.footer-watermark-container {
    margin-top: 80px;
    padding-top: 40px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-watermark-image {
    width: 80%;
    max-width: 1200px;
    opacity: 0.2;
    filter: grayscale(1) brightness(0);
    pointer-events: none;
    user-select: none;
    margin-top: 20px;
}

/* Scrollable slide adjustments */
.slide-content-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 380px;
    /* Increased bottom padding for characters */
    background: #181818;
}

/* Ensure slide 6 can be scrolled */
#slide-6 {
    overflow-y: auto !important;
    display: block !important;
}

/* Custom dropdown for language */
.lang-select {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.lang-select option {
    background: #cafe00;
    color: #000000;
}

/* Character Watermarks for Footer */
.footer-characters-container {
    position: relative;
    width: 100%;
    height: 220px;
    /* Increased height for more breathing room */
    margin-top: -180px;
    /* Adjusted pull-up for better sitting effect */
    pointer-events: none;
    z-index: 20;
    /* Increased to be higher than footer (z-index: 10) */
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.footer-char {
    position: absolute;
    bottom: -15px;
    /* Adjust sitting height */
    height: 100%;
    object-fit: contain;
}

/* Update these lines to move characters */
.char-back {
    z-index: 10;
    height: 190%;
    bottom: -45px;
    left: 17%;
    transform: translateX(-50%);
    opacity: 1;
}

.char-mid {
    z-index: 10;
    height: 150%;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.char-left {
    z-index: 8;
    height: 210%;
    bottom: -30px;
    left: 38%;
    transform: translateX(-50%);
}

.char-right {
    z-index: 8;
    height: 210%;
    bottom: -30px;
    left: 62%;
    transform: translateX(-50%);
}

.char-leftbot {
    z-index: 12;
    height: 220%;
    bottom: -200px;
    left: 29%;
    transform: translateX(-50%);
}

.char-rightbot {
    z-index: 12;
    height: 210%;
    bottom: -160px;
    left: 72%;
    transform: translateX(-50%);
}

.char-end {
    z-index: 10;
    height: 200%;
    bottom: -20px;
    left: 85%;
    transform: translateX(-50%);
}

@media (max-width: 1024px) {
    .footer-characters-container {
        height: 140px;
        margin-top: -110px;
    }

    .char-left {
        left: 25%;
    }

    .char-right {
        left: 75%;
    }

    .char-leftbot,
    .char-rightbot {
        display: none;
    }
}

@media (max-width: 768px) {
    .footer-characters-container {
        height: 100px;
        margin-top: -80px;
    }

    .char-left {
        left: 15%;
    }

    .char-right {
        left: 85%;
    }
}

/* expertise slide styles */
.expertise-slide-bg {
    background: radial-gradient(circle at 30% 30%, #363636 0%, #1F1F1F 45%, #0F0F0F 100%);
    position: absolute;
    overflow: hidden;
}

.expertise-slide-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, white, transparent),
        radial-gradient(1px 1px at 30% 50%, white, transparent),
        radial-gradient(1px 1px at 50% 80%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent);
    opacity: 0.2;
    pointer-events: none;
}

/* Free-Falling Expertise Pills Animation */
.expertise-pill {
    opacity: 0;
    transform: translateY(-800px) rotate(calc(var(--rot) - 45deg)) scale(0.8);
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity;
}

#slide-4-image-card.scale-100 .expertise-pill {
    opacity: 1;
    transform: translateY(0) rotate(var(--rot)) scale(1);
}

#slide-4-image-card.scale-100 .expertise-pill:hover {
    transform: translateY(-10px) rotate(var(--rot)) scale(1.05);
}

.rounded-expertise-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    width: 100%;
}

.chat-mockup-wrapper {
    perspective: 1000px;
}

.chat-mockup {
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.chat-mockup:hover {
    transform: rotateY(0) rotateX(0);
}

.chat-mockup-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    filter: blur(15px);
    z-index: -1;
}

/* Web Mockup Styles */
.web-mockup {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: flex-col;
    height: 100%;
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.web-mockup:hover {
    transform: rotateY(0) rotateX(0);
}

.browser-header {
    background: #f1f1f1;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e5e5e5;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.browser-address-bar {
    background: white;
    height: 20px;
    flex-grow: 1;
    margin-left: 15px;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    font-size: 10px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #999;
}

.browser-content {
    flex-grow: 1;
    padding: 20px;
    background: #fff;
    overflow-y: auto;
}

.mock-hero {
    height: 100px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 8px;
    margin-bottom: 15px;
}

.mock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mock-card {
    height: 60px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}