/* ============================================
   STAROCEAN JEWELLERY — Luxury Magazine Style
   Color Palette: Teal #00838f / #0097a7 / #4dd0e1
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #1a1a1a;
    font-family: 'Noto Serif SC', 'Cormorant Garamond', Georgia, serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 131, 143, 0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 131, 143, 0.45); }

/* ---- Navigation Bar ---- */
.nav-bar {
    background: linear-gradient(135deg, #004d54 0%, #00838f 50%, #0097a7 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: none;
    transition: background 0.4s ease;
}

.nav-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #8B6914 15%, 
        #C5A44E 30%, 
        #E8D5A3 50%, 
        #C5A44E 70%, 
        #8B6914 85%, 
        transparent 100%
    );
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: rgba(255,255,255,0.95) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4dd0e1;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link:hover::after {
    width: 100%;
}

.tts-btn,
.reset-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: inherit;
}

.tts-btn:hover,
.reset-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

/* ---- Hero / Product Showcase ---- */
.hero-section {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    height: 52vh;
    min-height: 300px;
    max-height: 600px;
    overflow: hidden;
    margin-top: 64px;
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.1);
    transition: transform 8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hero-gradient-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 25%, #1e3a5f 55%, #0d2b3e 80%, #0a1628 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 77, 84, 0.6) 0%,
        rgba(0, 131, 143, 0.3) 40%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 60px 48px;
    background: linear-gradient(0deg, rgba(0,0,0,0.65) 0%, transparent 100%);
    transition: opacity 0.6s ease;
}

.has-product .hero-content {
    opacity: 0;
    pointer-events: none;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 11px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: #4dd0e1;
    margin-bottom: 16px;
    font-weight: 400;
}

.hero-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 300;
    color: #fff;
    margin: 0 0 16px;
    letter-spacing: 0.15em;
    line-height: 1.3;
}

.hero-desc {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    font-weight: 300;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.1em;
    margin: 0;
}

/* Product Showcase Overlay */
.product-showcase {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(0,96,100,0.15) 0%, rgba(0,0,0,0.7) 100%);
}

.product-showcase.hidden {
    display: none;
}

.product-image,
.product-video {
    max-width: 85%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
    filter: drop-shadow(0 20px 60px rgba(0,0,0,0.4));
    animation: productReveal 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

/* Sound Toggle Button */
.sound-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(0, 131, 143, 0.6);
    border-color: rgba(77, 208, 225, 0.3);
    color: #fff;
}

.product-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.product-label {
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    background: rgba(0,96,100,0.5);
    backdrop-filter: blur(10px);
    padding: 10px 28px;
    border: 1px solid rgba(77,208,225,0.2);
    border-radius: 2px;
}

/* ---- Chat Section ---- */
.chat-wrapper {
    position: relative;
    background: #fafcfc;
    padding: 0;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, #4dd0e1, transparent);
}

.chat-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 24px 16px;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0,131,143,0.1);
    flex-shrink: 0;
}

.consultant-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.consultant-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00838f, #0097a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 16px rgba(0, 131, 143, 0.25);
}

.consultant-name {
    font-size: 14px;
    font-weight: 500;
    color: #004d54;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

.consultant-status {
    font-size: 11px;
    color: #0097a7;
    letter-spacing: 0.08em;
    margin: 0;
}

/* Messages */
.chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    animation: messageSlide 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-row {
    flex-direction: row;
    justify-content: flex-start;
}

.user-row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00838f, #0097a7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

.bot-bubble {
    background: rgba(0, 131, 143, 0.06);
    border: 1px solid rgba(0, 131, 143, 0.1);
    border-radius: 2px 16px 16px 16px;
    padding: 18px 22px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.85;
    color: #2a2a2a;
    letter-spacing: 0.03em;
    position: relative;
}

.bot-bubble::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #00838f, #4dd0e1);
    border-radius: 2px;
}

.user-bubble {
    background: linear-gradient(135deg, #00838f, #0097a7);
    color: #fff;
    border-radius: 16px 2px 16px 16px;
    padding: 16px 22px;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 20px rgba(0, 131, 143, 0.2);
}

/* Loading */
.loading-indicator {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    flex-shrink: 0;
}

.loading-indicator.hidden {
    display: none;
}

.loading-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0097a7;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Suggestion Chips */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0 16px;
    justify-content: center;
    flex-shrink: 0;
}

.suggestions.hidden {
    display: none;
}

.suggestion-chip {
    font-family: 'Noto Serif SC', serif;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: #00838f;
    background: transparent;
    border: 1px solid rgba(0, 131, 143, 0.25);
    padding: 10px 24px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.suggestion-chip:hover {
    background: rgba(0, 131, 143, 0.06);
    border-color: #00838f;
    color: #004d54;
    transform: translateY(-1px);
}

/* Input Area */
.input-area {
    padding: 12px 0 8px;
    border-top: 1px solid rgba(0,131,143,0.08);
    margin-top: 4px;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 131, 143, 0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #00838f;
    box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.08);
}

#user-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 20px;
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    letter-spacing: 0.03em;
}

#user-input::placeholder {
    color: #aaa;
    font-style: italic;
    letter-spacing: 0.05em;
}

.mic-btn,
.send-btn {
    background: transparent;
    border: none;
    color: #0097a7;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-btn:hover { color: #00838f; background: rgba(0,131,143,0.05); }
.send-btn:hover { color: #fff; background: #00838f; }

.mic-btn.listening {
    color: #e53935;
    animation: pulse 1.5s infinite;
}

.tts-btn.speaking {
    color: #4dd0e1;
    background: rgba(77, 208, 225, 0.15);
    border-color: rgba(77, 208, 225, 0.4);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- Footer ---- */
.site-footer {
    display: none;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,131,143,0.15), transparent);
    margin-bottom: 0;
}

/* ---- Fade In Utility ---- */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   MOBILE RESPONSIVE (< 768px)
   ============================================ */
@media (max-width: 768px) {
    .hero-section {
        height: 45vh;
        min-height: 240px;
    }

    .hero-content {
        padding: 32px 24px;
    }

    .hero-title {
        font-size: 28px;
        letter-spacing: 0.1em;
    }

    .hero-subtitle {
        font-size: 9px;
        letter-spacing: 0.35em;
        margin-bottom: 10px;
    }

    .hero-desc {
        font-size: 12px;
    }

    .chat-container {
        padding: 16px 16px 12px;
    }

    .chat-header {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }

    .consultant-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .consultant-name {
        font-size: 13px;
    }

    .chat-messages {
        max-height: none;
    }

    .bot-bubble {
        max-width: 88%;
        padding: 14px 16px;
        font-size: 13.5px;
        line-height: 1.75;
    }

    .user-bubble {
        max-width: 82%;
        padding: 12px 16px;
        font-size: 13.5px;
    }

    .bot-avatar {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 10px;
    }

    .suggestion-chip {
        font-size: 11px;
        padding: 8px 16px;
    }

    #user-input {
        padding: 14px 16px;
        font-size: 14px;
    }

    .mic-btn, .send-btn {
        padding: 12px 14px;
    }

    .product-image,
    .product-video {
        max-width: 92%;
        max-height: 75%;
    }

    .product-label {
        font-size: 9px;
        letter-spacing: 0.3em;
        padding: 8px 18px;
    }

    .product-caption {
        bottom: 24px;
    }
}

/* ============================================
   LARGE DESKTOP (>= 1200px)
   ============================================ */
@media (min-width: 1200px) {
    .hero-section {
        height: 52vh;
        max-height: 600px;
    }

    .hero-content {
        padding: 80px 80px;
    }

    .chat-container {
        max-width: 800px;
        padding: 28px 32px 24px;
    }

    .bot-bubble {
        font-size: 15px;
    }

    .user-bubble {
        font-size: 15px;
    }
}

/* ============================================
   ULTRA-WIDE (>= 1600px)
   ============================================ */
@media (min-width: 1600px) {
    .chat-container {
        max-width: 880px;
    }

    .hero-content {
        padding: 100px 120px;
    }
}

/* ---- Small Mobile (< 400px) ---- */
@media (max-width: 400px) {
    .hero-section {
        height: 40vh;
        min-height: 250px;
    }

    .hero-title {
        font-size: 24px;
    }

    .suggestions {
        gap: 6px;
    }

    .suggestion-chip {
        font-size: 10px;
        padding: 7px 12px;
    }

    .message-row {
        gap: 8px;
    }
}

/* ---- Landscape Mobile ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        height: 60vh;
        min-height: 280px;
    }

    .chat-messages {
        max-height: none;
    }
}
