:root {
    --bg: #000;
    --text: #ffffff;
    --accent: #d4af37;
    /* Gold */
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    overflow: hidden;
    color: var(--text);
}

/* Loader */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Swiper */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: center;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* RENDERING LOGIC: Background vs Product */
.swiper-slide[data-type="background"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 1.5s ease-in-out;
}

.swiper-slide-active[data-type="background"] img {
    opacity: 1;
}

.swiper-slide[data-type="product"] {
    background: radial-gradient(circle at center, #1b1b1b 0%, #000 70%);
    /* Highlight product */
}

.swiper-slide[data-type="product"] img {
    max-width: 80%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    transform: scale(0.95);
    transition: transform 0.8s ease-out, opacity 0.5s;
    opacity: 0;
}

.swiper-slide-active[data-type="product"] img {
    transform: scale(1);
    opacity: 1;
}

/* Top Navigation */
#top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    box-sizing: border-box;
    z-index: 100;
    pointer-events: none;
    /* Let clicks pass except on buttons */
}

#logo {
    font-size: 18px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.9;
    color: white;
}

.nav-filters {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
}

#partner-link {
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

#partner-link:hover {
    background: var(--accent);
    color: black;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* UI Container - Default (Desktop 3-Column) */
#ui-container {
    position: absolute;
    top: 80px;
    /* Below Nav */
    left: 0;
    width: 100%;
    height: calc(100% - 80px);
    z-index: 90;
    display: grid;
    grid-template-columns: 28% 44% 28%;
    pointer-events: none;
    box-sizing: border-box;
    transition: all 0.4s ease;
}

/* UI Container - Rich Text Mode (Full Screen Center) */
#ui-container.rich-page-mode {
    grid-template-columns: 28% 72% 0px;
    /* Hides right column completely, expands center while keeping chatbox */
}

.col-left,
.col-center,
.col-right {
    padding: 20px;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    transition: all 0.4s ease;
    /* Children that are interactive should have pointer-events: auto */
}

/* Left Column: Chatbox aligns to bottom */
.col-left {
    justify-content: flex-end;
    padding-bottom: 40px;
    padding-left: 40px;
    padding-right: 40px;
    pointer-events: none;
    z-index: 100;
}

/* Center Column: Page Content */
.col-center {
    justify-content: center;
    align-items: center;
}

#page-content-wrapper {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    border-radius: 12px;
    padding: 60px 60px 80px 60px;
    /* Extra bottom padding so text doesn't hit edge */
    margin: 20px 40px 20px 0;
    /* Add right margin so it doesn't touch the edge */
    pointer-events: auto;
    overflow-y: auto;
    height: 100%;
    /* Force fill */
    max-height: 100%;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Right Column: Info & Links aligns to top */
.col-right {
    justify-content: flex-start;
    align-items: center;
    padding-top: 20px;
    padding-right: 40px;
    text-align: center;
    pointer-events: auto;
    overflow: hidden;
    /* Prevent spill when resized to 0 */
}

#ui-container.rich-page-mode .col-right {
    padding: 0;
    opacity: 0;
}

#product-info-wrapper {
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Quill Image Wrapping */
#page-content-html img {
    max-width: 100%;
    height: auto;
    margin: 10px;
}

#page-content-html .ql-align-center {
    text-align: center;
}

#page-content-html .ql-align-right {
    text-align: right;
}

#page-content-html .ql-align-justify {
    text-align: justify;
}

/* Float images if they are aligned */
#page-content-html img.ql-align-left {
    float: left;
    margin: 10px 20px 10px 0;
}

#page-content-html img.ql-align-right {
    float: right;
    margin: 10px 0 10px 20px;
}

#page-content-html::after {
    content: "";
    display: table;
    clear: both;
}



#product-collection-name {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.doc-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 250px;
    max-width: 100%;
    margin: 0 auto 15px auto;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    box-sizing: border-box;
    text-align: center;
    font-family: inherit;
    font-size: 1rem;
}

.doc-link:hover {
    background: var(--accent);
    color: black;
}

/* Chat History with Masking */
#chat-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    pointer-events: auto;
    justify-content: flex-end;
    max-height: 250px;
    overflow: hidden;

    /* Fade Out Effect */
    mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
}

.message {
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
    width: fit-content;
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bot-msg {
    background: rgba(10, 10, 10, 0.7);
    color: #e0e0e0;
    border-left: 2px solid var(--accent);
    align-self: flex-start;
}

/* Thinking Indicator (Universal) */
.thinking-indicator {
    padding: 10px 16px !important;
    /* Slightly smaller padding */
    min-width: 40px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
    animation: pulseDots 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0;
}

@keyframes pulseDots {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}


.user-msg {
    background: var(--accent);
    color: #000;
    align-self: flex-end;
    text-align: right;
    border: none;
    font-weight: 500;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.input-container {
    pointer-events: auto;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 6px 8px;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 20px;
    color: white;
    font-size: 16px;
    outline: none;
    font-weight: 300;
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#send-btn {
    background: white;
    color: black;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    transform: scale(1.1);
}

/* (Removed old logo/partner-link absolute positioning) */

@media (max-width: 768px) {
    #top-nav {
        padding: 15px 20px;
        flex-wrap: wrap;
        /* Allow wrapping */
        gap: 10px;
    }

    .nav-filters {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    #partner-link {
        padding: 6px 12px;
        font-size: 12px;
    }

    #logo {
        font-size: 16px;
    }

    /* Mobile fallback to old layout style */
    #ui-container {
        display: flex;
        top: auto;
        bottom: 20px;
        height: auto;
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
    }

    .col-left {
        padding: 0;
        width: 100%;
        max-width: 550px;
        margin: 0 auto;
    }

    .col-center,
    .col-right {
        position: fixed;
        top: 120px;
        left: 5%;
        width: 90%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 110;
        padding: 20px;
        border-radius: 8px;
    }
}