@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    --primary: #f97316; /* Orange-500 optimized */
    --primary-dark: #c2410c;
    --primary-gradient: linear-gradient(135deg, #f97316, #ea580c);
    
    --bg-light: #fff7ed;
    --text-light: #18181b;
    --card-light: #ffffff;
    --border-light: rgba(0,0,0,0.05);

    --bg-dark: #0f0f10; /* Deeper black */
    --text-dark: #fafafa;
    --card-dark: #18181b;
    --border-dark: rgba(255,255,255,0.08);

    --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);
    --radius: 1rem;
}

* { box-sizing: border-box; }

body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Themes */
body.light { background-color: var(--bg-light); color: var(--text-light); }
body.dark { background-color: var(--bg-dark); color: var(--text-dark); }

/* Container & Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.header {
    position: fixed; top: 0; width: 100%; z-index: 50;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}
body.light .header { background: rgba(255,255,255,0.7); border-color: var(--border-light); }
body.dark .header { background: rgba(15, 15, 16, 0.7); border-color: var(--border-dark); }

.flex-between { display: flex; justify-content: space-between; align-items: center; }

.logo-area { display: flex; align-items: center; gap: 0.8rem; }
.logo-icon { color: var(--primary); filter: drop-shadow(0 0 5px rgba(249, 115, 22, 0.3)); }

.btn-icon {
    background: transparent; border: 1px solid transparent; padding: 0.6rem; 
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; 
    transition: all 0.2s ease;
}
body.light .btn-icon { color: #52525b; background: rgba(0,0,0,0.03); }
body.light .btn-icon:hover { background: rgba(0,0,0,0.08); }
body.dark .btn-icon { color: #d4d4d8; background: rgba(255,255,255,0.05); }
body.dark .btn-icon:hover { background: rgba(255,255,255,0.1); }

.cart-btn { position: relative; background: var(--primary-gradient) !important; color: white !important; border: none; box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3); }
.cart-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(234, 88, 12, 0.4); }
.badge {
    position: absolute; top: -2px; right: -2px; 
    background: white; color: #ea580c; 
    font-size: 0.75rem; font-weight: 800; 
    width: 20px; height: 20px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Hero */
.hero { 
    padding-top: 9rem; padding-bottom: 5rem; text-align: center; 
    position: relative; overflow: hidden;
}
/* Glow Effect for Hero */
.hero::before {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 600px; height: 600px; background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    z-index: -1; pointer-events: none;
}

.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; margin: 0 0 1rem 0; line-height: 1.1; letter-spacing: -0.02em; }
.hero span { 
    background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    display: inline-block;
}
.hero p { font-size: 1.1rem; margin-bottom: 2.5rem; opacity: 0.75; max-width: 600px; margin-left: auto; margin-right: auto; }

.btn-primary { 
    background: var(--primary-gradient); color: white; border: none; 
    padding: 1rem 2.5rem; border-radius: 2rem; 
    font-weight: 700; font-size: 1.1rem; 
    cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3); 
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(234, 88, 12, 0.4); }
.btn-primary:active { transform: translateY(-1px); }

/* Categories */
.categories-wrapper {
    position: sticky; top: 70px; z-index: 40;
    padding: 1rem 0; margin-bottom: 1rem;
    backdrop-filter: blur(8px);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
body.light .categories-wrapper { background: rgba(255, 247, 237, 0.8); }
body.dark .categories-wrapper { background: rgba(15, 15, 16, 0.8); }

.categories { 
    display: flex; gap: 0.8rem; overflow-x: auto; padding: 0.5rem 1.5rem; 
    scrollbar-width: none; justify-content: center;
}
.categories::-webkit-scrollbar { display: none; }

.cat-btn { 
    padding: 0.6rem 1.5rem; border-radius: 2rem; 
    border: 1px solid transparent; 
    background: transparent; cursor: pointer; 
    font-family: inherit; font-weight: 600; white-space: nowrap; 
    transition: all 0.2s; font-size: 0.95rem;
}
body.light .cat-btn { color: #71717a; background: white; border-color: #e4e4e7; }
body.dark .cat-btn { color: #a1a1aa; background: #27272a; border-color: #3f3f46; }

.cat-btn:hover { transform: scale(1.05); }

.cat-btn.active { 
    background: var(--primary); color: white; border-color: var(--primary); 
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Menu Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }

.card { 
    border-radius: 1.5rem; overflow: hidden; 
    transition: all 0.3s ease; position: relative; 
    display: flex; flex-direction: column;
    border: 1px solid transparent;
}
body.light .card { background: white; border-color: #f3f4f6; box-shadow: var(--shadow-sm); }
body.dark .card { background: #18181b; border-color: #27272a; box-shadow: none; }

.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.card:hover img { transform: scale(1.05); }

.img-wrapper { position: relative; height: 220px; overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }

.price-badge { 
    position: absolute; bottom: 0.8rem; left: 0.8rem; 
    background: rgba(0,0,0,0.75); color: #fff; 
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.8rem; border-radius: 0.8rem; 
    font-weight: 700; font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.5rem 0; }
.card-desc { 
    font-size: 0.9rem; opacity: 0.7; margin-bottom: 1.2rem; line-height: 1.5; 
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    flex-grow: 1;
}

.btn-add {
    width: 100%; padding: 0.8rem; border: none; border-radius: 0.8rem;
    background: rgba(249, 115, 22, 0.1); color: var(--primary);
    font-weight: 700; font-family: inherit; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-add:hover { background: var(--primary); color: white; }

/* Drawer & Modal Animations */
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Cart Drawer */
.drawer-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 99; display: none; opacity: 0; transition: opacity 0.3s; 
}
.drawer { 
    position: fixed; top: 0; left: 0; height: 100%; width: 100%; max-width: 400px; 
    z-index: 100; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; flex-direction: column; 
    box-shadow: 5px 0 25px rgba(0,0,0,0.2);
}
body.light .drawer { background: white; }
body.dark .drawer { background: #18181b; }

.drawer.open { transform: translateX(0); }
.drawer-overlay.open { display: block; opacity: 1; }

/* Chat Modal */
.chat-modal { position: fixed; inset: 0; z-index: 110; display: none; align-items: center; justify-content: center; padding: 1rem; }
.chat-modal.open { display: flex; animation: fadeIn 0.2s forwards; }
.chat-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); }

.chat-box { 
    width: 100%; max-width: 450px; height: 85vh; 
    border-radius: 1.5rem; overflow: hidden; position: relative; z-index: 111; 
    display: flex; flex-direction: column;
    animation: popUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
body.light .chat-box { background: white; }
body.dark .chat-box { background: #18181b; border: 1px solid #333; }

.chat-header {
    padding: 1rem 1.5rem; 
    background: var(--primary-gradient); 
    color: white; 
    display: flex; justify-content: space-between; align-items: center;
}

.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; scroll-behavior: smooth; }

.msg { 
    padding: 0.8rem 1.2rem; border-radius: 1.2rem; max-width: 85%; 
    line-height: 1.6; font-size: 0.95rem; white-space: pre-line; 
    position: relative; animation: fadeIn 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.msg.ai { 
    background: #f4f4f5; color: #333; 
    border-bottom-right-radius: 0.2rem; align-self: flex-start; 
}
body.dark .msg.ai { background: #27272a; color: #e4e4e7; }

.msg.user { 
    background: var(--primary); color: white; 
    border-bottom-left-radius: 0.2rem; align-self: flex-end; 
}

/* FAB */
.fab { 
    position: fixed; bottom: 2rem; left: 2rem; width: 64px; height: 64px; 
    background: var(--primary-gradient); 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    color: white; box-shadow: 0 10px 25px rgba(234, 88, 12, 0.4); 
    cursor: pointer; z-index: 90; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
}
.fab:hover { transform: scale(1.1) rotate(10deg); box-shadow: 0 15px 35px rgba(234, 88, 12, 0.5); }

/* Form Elements */
input, textarea { 
    width: 100%; padding: 1rem; border-radius: 0.8rem; 
    border: 1px solid #e4e4e7; background: transparent; 
    font-family: inherit; margin-bottom: 0.8rem; outline: none; 
    transition: 0.2s; font-size: 0.95rem;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
body.dark input, body.dark textarea { border-color: #3f3f46; color: white; background: rgba(255,255,255,0.02); }
body.dark input:focus, body.dark textarea:focus { border-color: var(--primary); }

.hide { display: none !important; }

/* Cart Item Styling */
.cart-item {
    display: flex; gap: 1rem; margin-bottom: 1rem; padding: 0.8rem; 
    border-radius: 1rem; transition: 0.2s;
}
body.light .cart-item { background: #f9fafb; border: 1px solid #e5e7eb; }
body.dark .cart-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); }

.qty-btn {
    width: 28px; height: 28px; border-radius: 50%; border: none; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; font-weight: bold; transition: 0.2s;
}
.qty-btn.minus { background: rgba(0,0,0,0.1); color: inherit; }
.qty-btn.plus { background: var(--primary); color: white; }
.qty-btn:hover { transform: scale(1.1); }

/* Footer & Developer Card Styles */
.footer {
    background: var(--bg-dark);
    color: var(--text-dark);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-dark);
}
body.light .footer {
    background: #fff;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.restaurant-info h3 { margin-top: 0; color: var(--primary); margin-bottom: 0.5rem; }
.info-item { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; opacity: 0.8; }

.btn-location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(128,128,128,0.1);
    color: inherit;
    padding: 0.6rem 1.2rem;
    border-radius: 0.8rem;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
    margin-top: 1rem;
    border: 1px solid transparent;
}
.btn-location:hover { background: rgba(128,128,128,0.2); border-color: var(--primary); }

/* Developer Card */
.dev-card {
    background: rgba(128, 128, 128, 0.05);
    backdrop-filter: blur(10px);
    padding: 1.2rem;
    border-radius: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid rgba(128, 128, 128, 0.1);
    min-width: 280px;
    transition: 0.3s;
}
.dev-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }

.dev-header { display: flex; align-items: center; gap: 0.8rem; }
.dev-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.dev-info { display: flex; flex-direction: column; }
.dev-role { font-size: 0.75rem; opacity: 0.7; }
.dev-name { margin: 0; font-size: 1rem; font-weight: bold; }

.dev-actions { display: flex; gap: 0.5rem; }
.dev-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 0.6rem;
    text-align: center;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 0.3rem;
}
.btn-website { background: rgba(128, 128, 128, 0.1); color: inherit; }
.btn-website:hover { background: rgba(128, 128, 128, 0.2); }

.btn-whatsapp { background: #25D366; color: white; }
.btn-whatsapp:hover { background: #1ebc59; }

.copyright {
    text-align: center;
    opacity: 0.5;
    font-size: 0.85rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
}
