/* ===== CSS Variables ===== */
:root {
    --gold: #F5C237;
    --gold-glow: rgba(245, 194, 55, 0.5);
    --gold-dim: rgba(245, 194, 55, 0.2);
    --black: #0A0A0A;
    --dark: #1A1A1A;
    --charcoal: #333333;
    --light: #F5F5F5;
    --light-dim: rgba(245, 245, 245, 0.6);
    --gradient-gold: linear-gradient(135deg, #F5C237 0%, #E5A820 100%);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--black);
    color: var(--light);
    -webkit-font-smoothing: antialiased;
}

/* ===== Splash Screen ===== */
#splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(245, 194, 55, 0.08) 0%, var(--black) 70%);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#splash.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

#particle-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.splash-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.splash-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.splash-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-gold);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--dark);
    box-shadow: 0 0 40px var(--gold-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 30px var(--gold-glow);
    }

    50% {
        box-shadow: 0 0 60px var(--gold-glow);
    }
}

.splash-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light);
    letter-spacing: -0.02em;
}

.splash-title .typed {
    color: var(--gold);
    display: inline-block;
    border-right: 3px solid var(--gold);
    padding-right: 4px;
    animation: blink 0.7s infinite;
}

@keyframes blink {

    0%,
    50% {
        border-color: var(--gold);
    }

    51%,
    100% {
        border-color: transparent;
    }
}

.splash-tagline {
    font-size: 1.1rem;
    color: var(--light-dim);
    margin-top: 8px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.6s ease forwards 0.5s;
}

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

.splash-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 1.0s;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--dark);
    border: 1px solid var(--gold-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 20px;
}

.feature-label {
    font-size: 0.75rem;
    color: var(--light-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.splash-loader {
    margin: 60px auto 0;
    width: 280px;
    height: 3px;
    background: var(--charcoal);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 1.2s;
}

.loader-bar {
    height: 100%;
    width: 0;
    background: var(--gradient-gold);
    border-radius: 2px;
    animation: loading 1.8s ease-in-out forwards 1.5s;
}

@keyframes loading {
    to {
        width: 100%;
    }
}

/* ===== Chat Interface ===== */
#chat-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: none;
}

#chat-app.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--dark);
    border-bottom: 1px solid var(--charcoal);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--dark);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--gold);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Header Logos */
.header-logos {
    display: flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* iOS-style container for header logos */
.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: white;
    padding: 6px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Remove specific filter rules as both are now in white container */
.header-logo img {
    filter: none;
}

.header-logo:not(:first-child) img {
    filter: brightness(0.95);
}

.header-logo:hover {
    opacity: 0.8;
    transform: scale(1.08);
}

.header-logo-divider {
    color: var(--gold);
    font-size: 1rem;
    opacity: 0.5;
    font-weight: 300;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: var(--charcoal);
    border: none;
    border-radius: 8px;
    color: var(--light-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--gold-dim);
    color: var(--gold);
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(to bottom, var(--dark) 0%, var(--black) 100%);
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.message:not(.user) .message-avatar {
    background: var(--gradient-gold);
    color: var(--dark);
}

.message.user .message-avatar {
    background: var(--charcoal);
    color: var(--light-dim);
}

.message-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message:not(.user) .message-content {
    background: var(--charcoal);
    color: var(--light);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: var(--gradient-gold);
    color: var(--dark);
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes bounce {

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

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

/* Quick Actions */
.quick-actions-wrapper {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px solid var(--charcoal);
}

.quick-category {
    margin-bottom: 24px;
}

.quick-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 12px;
    padding-left: 4px;
    letter-spacing: 0.02em;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-btn {
    padding: 10px 16px;
    background: var(--dark);
    border: 1px solid var(--charcoal);
    border-radius: 20px;
    color: var(--light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--gold-dim);
}

.quick-btn:active {
    transform: translateY(0);
}

/* Hot Topic Badge */
.quick-btn.hot {
    background: linear-gradient(135deg, var(--dark) 0%, rgba(245, 194, 55, 0.15) 100%);
    border-color: var(--gold);
    animation: slideInFromRight 0.8s ease-out;
    position: relative;
}

.quick-btn.hot::before {
    content: '🔥';
    margin-right: 4px;
    animation: pulse 2s ease-in-out infinite;
}

.quick-btn.hot::after {
    content: '热门';
    font-size: 0.65rem;
    background: var(--gradient-gold);
    color: var(--dark);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.quick-btn.hot[data-lang="en"]::after {
    content: 'HOT';
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.quick-btn.hot:hover {
    background: linear-gradient(135deg, var(--gold-dim) 0%, rgba(245, 194, 55, 0.3) 100%);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--gold-glow);
}

/* Input Area */
.chat-input-area {
    padding: 16px 24px 24px;
    background: var(--dark);
    border-top: 1px solid var(--charcoal);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.chat-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--charcoal);
    border: 2px solid transparent;
    border-radius: 24px;
    color: var(--light);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input::placeholder {
    color: var(--light-dim);
}

.chat-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-dim);
}

.send-btn {
    width: 52px;
    height: 52px;
    background: var(--gradient-gold);
    border: none;
    border-radius: 50%;
    color: var(--dark);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--gold-dim);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px var(--gold-glow);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.chat-footer {
    background: var(--dark);
    border-top: 1px solid var(--charcoal);
    padding: 16px 24px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    display: inline-block;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-logo img {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: brightness(0.9);
}

.footer-logo:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.footer-divider {
    color: var(--gold);
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.footer-text {
    color: var(--light-dim);
}

.footer-whatsapp {
    color: var(--gold);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 16px;
    background: rgba(245, 194, 55, 0.1);
}

.footer-whatsapp:hover {
    background: var(--gold-dim);
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--light-dim);
    opacity: 0.7;
    text-align: center;
}

.btn-back {
    position: relative;
}

.btn-back:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -28px;
    right: 0;
    background: var(--charcoal);
    color: var(--gold);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header-logos {
        gap: 8px;
    }

    .header-logo:first-child {
        padding: 4px 6px;
    }

    .header-logo img {
        height: 24px;
    }

    .quick-btn {
        font-size: 0.82rem;
        padding: 9px 14px;
    }
}

@media (max-width: 640px) {
    .splash-title {
        font-size: 1.8rem;
    }

    .splash-features {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .feature-item {
        min-width: 80px;
    }

    .chat-header {
        padding: 12px 16px;
        position: relative;
    }

    .header-logos {
        display: none;
    }

    .header-brand h1 {
        font-size: 1.1rem;
    }

    .header-brand span {
        font-size: 0.7rem;
    }

    .brand-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .chat-body {
        padding: 16px;
    }

    .chat-input-area {
        padding: 12px 16px 16px;
    }

    .chat-input {
        padding: 14px 18px;
        font-size: 0.95rem;
    }

    .send-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    .quick-category {
        margin-bottom: 18px;
    }

    .category-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .quick-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .quick-btn.hot::after {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .footer-logo img {
        height: 22px;
    }

    .footer-logos {
        gap: 10px;
    }

    .footer-content {
        padding: 0;
        gap: 10px;
    }

    .footer-links {
        flex-direction: column;
        gap: 6px;
        font-size: 0.8rem;
    }

    .footer-copyright {
        font-size: 0.65rem;
    }

    .footer-whatsapp {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 1.5rem;
    }

    .header-brand h1 {
        font-size: 1rem;
    }

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

    .message-content {
        font-size: 0.85rem;
    }

    .quick-btn {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    .category-title {
        font-size: 0.8rem;
    }
}

/* Scrollbar */
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb {
    background: var(--charcoal);
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dim);
}

/* BlackSea Branding - Matching user's design */
.bs-brand-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--gold);
    text-align: center;
    margin-top: 20px;
    display: inline-block;
    text-decoration: none;
    text-shadow: 0 0 20px var(--gold-glow), 0 0 40px var(--gold-dim);
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 10px;
}

.bs-brand-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--gradient-gold);
    box-shadow: 0 0 10px var(--gold);
}