:root {
    /* Colors */
    --navy-900: #0a192f;
    --navy-800: #112240;
    --navy-700: #233554;
    --solar-yellow: #FFB800;
    --solar-orange: #FF7B00;
    --text-main: #e6f1ff;
    --text-muted: #8892b0;
    --white: #ffffff;
    
    /* Gradients */
    --bg-gradient: linear-gradient(135deg, #0a192f 0%, #0d2142 100%);
    --accent-gradient: linear-gradient(135deg, var(--solar-yellow) 0%, var(--solar-orange) 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(17, 34, 64, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile width constraint for desktop view */
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-image: radial-gradient(circle at top right, rgba(255, 184, 0, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(255, 123, 0, 0.1), transparent 40%);
}

@media (min-width: 481px) {
    .app-container {
        height: 90vh;
        border-radius: 24px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
        border: 1px solid var(--glass-border);
        overflow: hidden;
    }
}

/* Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-message {
    background: rgba(35, 53, 84, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
}

/* Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    z-index: 10;
}

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

.avatar-container {
    position: relative;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 4px 10px rgba(255, 184, 0, 0.3);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #00e676;
    border-radius: 50%;
    border: 2px solid var(--navy-800);
}

.header-info h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.header-info p {
    font-size: 0.8rem;
    color: var(--solar-yellow);
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: var(--navy-700);
    border-radius: 10px;
}

.message-container {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease-out forwards;
}

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

.message-container.ai {
    align-self: flex-start;
}

.message-container.user {
    align-self: flex-end;
}

.message {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-container.ai .message {
    border-top-left-radius: 4px;
    color: var(--text-main);
}

.message-container.user .message {
    background: var(--accent-gradient);
    color: var(--navy-900);
    font-weight: 500;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(255, 184, 0, 0.2);
}

.timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    align-self: flex-end;
}
.message-container.ai .timestamp {
    align-self: flex-start;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 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 typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Footer / Input */
.chat-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(35, 53, 84, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 8px;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    padding: 8px 4px;
    outline: none;
}

textarea::placeholder {
    color: var(--text-muted);
}

.voice-btn {
    color: var(--solar-yellow);
}

.send-btn {
    background: var(--accent-gradient);
    color: var(--navy-900);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn i {
    width: 18px;
    height: 18px;
    margin-left: 2px;
}

/* Product Card Component */
.product-card {
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    min-width: 260px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.badge {
    background: rgba(255, 184, 0, 0.2);
    color: var(--solar-yellow);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.accent-icon {
    color: var(--solar-yellow);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.card-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.spec-item i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.card-price {
    background: rgba(10, 25, 47, 0.5);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.price-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.price-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--solar-orange);
}

.card-finance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(0, 230, 118, 0.1);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid #00e676;
    margin-bottom: 16px;
}

.card-finance i {
    color: #00e676;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.card-finance p {
    font-size: 0.8rem;
    line-height: 1.4;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--accent-gradient);
    border: none;
    color: var(--navy-900);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.action-btn:active {
    transform: scale(0.98);
}

/* Markdown Styles inside AI Message */
.message-container.ai .message p {
    margin-bottom: 8px;
}
.message-container.ai .message p:last-child {
    margin-bottom: 0;
}
.message-container.ai .message ul, 
.message-container.ai .message ol {
    margin-left: 20px;
    margin-bottom: 8px;
}
.message-container.ai .message li {
    margin-bottom: 4px;
}
.message-container.ai .message h3 {
    font-size: 1.1rem;
    margin-top: 12px;
    margin-bottom: 8px;
    color: var(--solar-yellow);
}
.message-container.ai .message strong {
    color: var(--solar-yellow);
}

.icon-btn.disabled {
    color: var(--navy-700);
}
.icon-btn.disabled:hover {
    color: var(--text-muted);
}

/* Image Upload Preview */
.image-preview-container {
    position: relative;
    padding: 12px 20px 0;
    display: flex;
    justify-content: flex-start;
}

#image-preview {
    max-height: 100px;
    max-width: 100px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    left: 104px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 50%;
    z-index: 10;
}

.remove-image-btn:hover {
    background: rgba(255, 0, 0, 0.7);
    color: white;
}

.remove-image-btn i {
    width: 16px;
    height: 16px;
}

/* Message Image styling */
.message-image {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
    display: block;
}

/* Footer Badge */
.footer-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-badge i {
    width: 14px;
    height: 14px;
}
