:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --user-msg-bg: #3b82f6;
    --ai-msg-bg: #1e293b;
    --card-bg: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-color);
    position: relative;
}

/* Header */
.chat-header {
    padding: 1rem;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container {
    position: relative;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border: 2px solid var(--bg-color);
    border-radius: 50%;
}

.header-info h1 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Chat Area */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.ai-message .message-content {
    background-color: var(--ai-msg-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.user-message .message-content {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-md);
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 4px;
}

.user-message .message-time {
    margin-right: 4px;
}

/* Accommodation Cards */
.cards-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 4px 4px 16px 4px;
    /* Bottom padding for shadow */
    margin-top: 8px;
    width: 100%;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.cards-container::-webkit-scrollbar {
    display: none;
}

.hotel-card {
    min-width: 280px;
    max-width: 280px;
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    scroll-snap-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.hotel-card:active {
    transform: scale(0.98);
}

.card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-content {
    padding: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.hotel-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hotel-location {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-badge {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fbbf24;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.price-tag {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.book-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* Input Area */
.input-area {
    padding: 1rem;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    gap: 8px;
    background-color: var(--surface-color);
    padding: 8px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.input-container:focus-within {
    border-color: var(--primary-color);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 1rem;
    outline: none;
}

#send-btn {
    background: var(--primary-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background-color: var(--ai-msg-bg);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    border: 1px solid var(--border-color);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile-First Adjustments */
.mobile-only {
    display: block;
}

#menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

#close-sidebar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* User Section */
.user-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.full-width-btn {
    width: 100%;
    padding: 10px;
    background-color: white;
    color: #333;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.full-width-btn:hover {
    background-color: #f1f5f9;
}

/* Sidebar Menu & History */
.sidebar-menu,
.sidebar-history {
    padding: 1.5rem;
}

.sidebar-menu h3,
.sidebar-history h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.menu-list,
.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.menu-item:hover,
.menu-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.history-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    width: 100%;
}

/* Desktop Responsive Styles */
@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
        max-width: 100%;
        /* Full width on desktop */
    }

    .mobile-only {
        display: none !important;
    }

    .sidebar {
        position: relative;
        /* Static on desktop */
        transform: none;
        width: 300px;
        flex-shrink: 0;
        border-right: 1px solid var(--border-color);
    }

    .main-content {
        height: 100vh;
    }

    .chat-area {
        max-width: 900px;
        /* Limit chat width for readability */
        margin: 0 auto;
        width: 100%;
    }

    .input-area {
        max-width: 900px;
        margin: 0 auto;
        width: 100%;
    }

    .chat-header {
        padding: 1.5rem 2rem;
    }
}