:root {
    --bg-color: #050505;
    --panel-bg: rgba(25, 25, 25, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-color: #d4af37; /* Gold accent to match premium feel */
    --accent-hover: #bda030;
    --user-msg-bg: #d4af37;
    --user-msg-text: #000000;
    --bot-msg-bg: rgba(40, 40, 40, 0.8);
    --font-family: 'Tajawal', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03), transparent 25%);
    background-attachment: fixed;
}

.app-container {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.main-header {
    text-align: center;
    padding: 1rem 0 2rem 0;
}

.info-section {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.1));
}

.brand-name {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.brand-tagline {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.menu-container {
    width: 100%;
}

.main-menu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.main-menu-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-color);
}

.main-menu-toggle h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.main-menu-toggle .arrow {
    transition: transform 0.3s ease;
}

.main-menu-toggle.open .arrow {
    transform: rotate(180deg);
}

.menu-list {
    padding-right: 0.5rem;
}

.menu-category {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-3px);
}

.item-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.item-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Contact Info */
.contact-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.contact-container h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 700;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
    color: var(--accent-color);
    transform: translateX(-5px);
}

.phone-link {
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.05);
}

/* --- Main Chat Area --- */
.chat-area {
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    height: 600px;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

.chat-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, rgba(5,5,5,0.9), transparent);
    z-index: 5;
    position: relative;
}

.menu-toggle {
    display: none;
}

.chat-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to left, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chat-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

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

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.message {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    max-width: 80%;
    animation: fadeIn 0.4s ease forwards;
}

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

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

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

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.ai-avatar {
    background: linear-gradient(135deg, #1e1e1e, #0a0a0a);
    color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.4);
}

.user-message .avatar {
    background: var(--accent-color);
    color: #000;
    font-weight: bold;
    font-size: 0.85rem;
}

.bubble {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.85rem; /* Reduced font size */
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.bot-message .bubble {
    background: var(--bot-msg-bg);
    border-top-right-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

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

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-self: flex-start;
    background: var(--bot-msg-bg);
    padding: 1rem 1.5rem;
    border-radius: 18px;
    border-top-right-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    margin: 0 2px;
    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); }
    40% { transform: scale(1); }
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem 2rem 5rem 2rem; /* Raised higher by increasing bottom padding */
    background: linear-gradient(to top, rgba(5,5,5,1) 40%, transparent);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    margin-left: auto;
    background: var(--panel-bg);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: max-content;
}

#image-preview {
    max-height: 80px;
    max-width: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-form {
    display: flex;
    gap: 1rem;
    background: var(--panel-bg);
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
    align-items: center;
}

.upload-btn {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.upload-btn:hover {
    color: var(--accent-color);
}

.chat-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Responsive */
@media (max-width: 900px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-area {
        height: 500px;
    }
}
