/* Chat-Centric Theme for ZapStart */
:root {
    --bg-body: #ffffff;
    --bg-sidebar: #f8fafc;
    --bg-chat: #ffffff;
    --border-color: #e2e8f0;

    --primary-color: #0f172a;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --chat-bubble-user: #2563eb;
    --chat-text-user: #ffffff;
    --chat-bubble-bot: #f1f5f9;
    --chat-text-bot: #0f172a;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    height: 100vh;
    /* Fallback */
    min-height: -webkit-fill-available;
    /* iOS Fallback */
    height: 100dvh;
    /* Dynamic viewport height for modern mobile browsers */
    overflow: hidden;
    display: flex;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling for iOS */
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
    height: -webkit-fill-available;
    /* Base size to prevent auto-zoom on iOS */
}

/* Sidebar */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-decoration: none;
}

.brand i {
    color: #FFD700;
}

.services-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.nav-item.active {
    background: white;
    box-shadow: var(--shadow-sm);
    color: var(--accent-color);
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Chat Interface */
.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-chat);
    position: relative;
    max-width: 100%;
}

.chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.partner-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background-color: #0f172a;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-login-btn:hover {
    background-color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: white;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

/* Messages */
.message {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    animation: fadeIn 0.3s ease-out;
}

.message.bot {
    align-self: flex-start;
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.avatar.bot {
    background: var(--primary-color);
    color: #FFD700;
}

.avatar.user {
    background: #e2e8f0;
    color: var(--text-secondary);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 80%;
}

.bubble {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
}

.message.bot .bubble {
    background: var(--chat-bubble-bot);
    color: var(--chat-text-bot);
    border-top-left-radius: 4px;
}

.message.user .bubble {
    background: var(--chat-bubble-user);
    color: var(--chat-text-user);
    border-top-right-radius: 4px;
    text-align: right;
}

.input-area {
    padding: 1.5rem 2rem 2rem;
    background: white;
    border-top: 1px solid transparent;
    /* Optional */
}

/* Updated Input Container for Modern Look */
.input-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: white;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-primary);
    min-height: 24px;
    max-height: 120px;
    resize: none;
    outline: none;
    font-size: 16px;
    /* Prevents iOS zoom */
    touch-action: manipulation;
}

.chat-input::placeholder {
    color: #94a3b8;
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Animations table */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Welcome Screen Content */
.welcome-hero {
    text-align: center;
    padding: 2rem 0;
}

.welcome-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .chat-header {
        padding: 0 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .input-area {
        padding: 1rem;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 90;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .bubble {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .chat-header {
        height: 56px;
    }

    .partner-login-btn {
        padding: 0;
        gap: 0;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        justify-content: center;
    }


    .partner-login-btn i {
        font-size: 1.1rem;
        margin-right: 0;
    }

    .partner-login-btn span {
        display: none;
    }

}