/* ============================================================
   Cloud Kitchen v4.0 - Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Tajawal', sans-serif; }
html[dir="ltr"] body { font-family: 'Tajawal', sans-serif; }

/* Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #FF6B35; border-radius: 4px; }

/* Animations */
@keyframes slide-down { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce-in { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; } }

.animate-slide-down { animation: slide-down 0.4s ease; }
.animate-slide-up { animation: slide-up 0.4s ease; }
.animate-fade-in { animation: fade-in 0.3s ease; }
.animate-spin { animation: spin 0.8s linear infinite; }
.animate-bounce-in { animation: bounce-in 0.5s ease; }

/* Brand colors */
:root {
  --brand: #FF6B35;
  --brand-dark: #e55b25;
  --brand-light: #fff3ee;
  --dark: #1a1a2e;
  --card: #ffffff;
  --muted: #6b7280;
}

/* Bottom nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #f0f0f0; display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 20px rgba(0,0,0,0.08); }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px 6px; cursor: pointer; color: #9ca3af; transition: all 0.2s; position: relative; }
.bottom-nav-item.active { color: var(--brand); }
.bottom-nav-item span { font-size: 10px; margin-top: 2px; font-weight: 500; }
.bottom-nav-badge { position: absolute; top: 6px; right: calc(50% - 16px); background: #ef4444; color: white; font-size: 9px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* Hero slide */
.hero-slide { border-radius: 20px; overflow: hidden; position: relative; min-height: 180px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; text-align: center; }
.hero-slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0) 100%); }

/* Slides container */
.slides-wrapper { overflow: hidden; border-radius: 20px; }
.slides-track { display: flex; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.slide-item { min-width: 100%; }

/* Product card */
.product-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: all 0.3s; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card img, .product-card .img-placeholder { width: 100%; height: 160px; object-fit: cover; }
.product-card .img-placeholder { background: linear-gradient(135deg, #ffe5d5, #ffd0b0); display: flex; align-items: center; justify-content: center; font-size: 3rem; }

/* Category pill */
.cat-pill { padding: 8px 18px; border-radius: 50px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; white-space: nowrap; flex-shrink: 0; }
.cat-pill.active { background: var(--brand); color: white; }
.cat-pill:not(.active) { background: white; color: #374151; border-color: #e5e7eb; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: flex-end; justify-content: center; padding: 16px; animation: fade-in 0.2s; }
.modal-box { background: white; border-radius: 28px 28px 20px 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; animation: slide-up 0.3s; }
.modal-handle { width: 40px; height: 4px; background: #e5e7eb; border-radius: 2px; margin: 12px auto 0; }

/* Admin sidebar */
.admin-sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: 260px; background: #1a1a2e; z-index: 200; transform: translateX(100%); transition: transform 0.3s; overflow-y: auto; }
.admin-sidebar.open { transform: translateX(0); }
html[dir="ltr"] .admin-sidebar { right: auto; left: 0; transform: translateX(-100%); }
html[dir="ltr"] .admin-sidebar.open { transform: translateX(0); }
.admin-sidebar-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; color: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.2s; font-size: 14px; border-radius: 12px; margin: 2px 8px; }
.admin-sidebar-item:hover, .admin-sidebar-item.active { background: rgba(255,107,53,0.2); color: #FF6B35; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-preparing { background: #dbeafe; color: #1e3a8a; }
.badge-ready { background: #d1fae5; color: #065f46; }
.badge-delivering { background: #ede9fe; color: #5b21b6; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-connected { background: #d1fae5; color: #065f46; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-configured { background: #dbeafe; color: #1e40af; }
.badge-not_configured { background: #f3f4f6; color: #6b7280; }
.badge-configured_no_token { background: #fef3c7; color: #92400e; }

/* Star rating */
.star-btn { cursor: pointer; color: #d1d5db; transition: color 0.15s; }
.star-btn.active, .star-btn:hover { color: #f59e0b; }

/* Inputs */
.ck-input { width: 100%; padding: 12px 16px; border: 2px solid #e5e7eb; border-radius: 14px; font-family: inherit; font-size: 14px; outline: none; transition: border-color 0.2s; background: white; }
.ck-input:focus { border-color: var(--brand); }

/* Btn */
.ck-btn { padding: 14px 24px; border-radius: 16px; font-family: inherit; font-weight: 700; cursor: pointer; transition: all 0.2s; border: none; font-size: 15px; }
.ck-btn-primary { background: linear-gradient(135deg, #FF6B35, #e55b25); color: white; box-shadow: 0 4px 15px rgba(255,107,53,0.3); }
.ck-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,107,53,0.4); }
.ck-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.ck-btn-outline { background: transparent; border: 2px solid var(--brand); color: var(--brand); }
.ck-btn-gray { background: #f3f4f6; color: #374151; }

/* Order tracker */
.order-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.order-step::after { content: ''; position: absolute; top: 18px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: #e5e7eb; z-index: 0; }
html[dir="ltr"] .order-step::after { left: calc(-50% + 18px); right: calc(50% + 18px); }
.order-step:last-child::after { display: none; }
.order-step.done::after { background: var(--brand); }
.step-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; background: #f3f4f6; color: #9ca3af; font-size: 14px; }
.order-step.done .step-circle { background: var(--brand); color: white; }
.order-step.active .step-circle { background: var(--brand); color: white; box-shadow: 0 0 0 6px rgba(255,107,53,0.2); }

/* Marketing platform cards */
.platform-card { background: white; border-radius: 20px; padding: 20px; border: 2px solid #e5e7eb; transition: all 0.2s; }
.platform-card.enabled { border-color: #86efac; background: #f0fdf4; }
.platform-toggle { width: 50px; height: 26px; background: #d1d5db; border-radius: 13px; cursor: pointer; position: relative; transition: background 0.3s; }
.platform-toggle.on { background: #22c55e; }
.platform-toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.3s; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
html[dir="ltr"] .platform-toggle::after { right: auto; left: 3px; }
.platform-toggle.on::after { transform: translateX(-24px); }
html[dir="ltr"] .platform-toggle.on::after { transform: translateX(24px); }

/* Scrollable horizontal tabs */
.tab-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tab-scroll::-webkit-scrollbar { display: none; }

/* Cloud logo */
.cloud-logo { display: inline-flex; align-items: center; gap: 8px; }
.cloud-logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, #FF6B35, #e55b25); border-radius: 10px; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(255,107,53,0.3); }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Safe area */
.pb-safe { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

/* Smooth page transitions */
#app { animation: fade-in 0.2s ease; }

/* Admin tabs */
.admin-tab { padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.admin-tab.active { background: var(--brand); color: white; }
.admin-tab:not(.active) { background: #f3f4f6; color: #6b7280; }
.admin-tab:not(.active):hover { background: #e5e7eb; color: #374151; }

/* Card hover */
.stat-card { background: white; border-radius: 20px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: all 0.2s; }
.stat-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }

/* Toggle switch */
.toggle-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-input { width: 0; height: 0; opacity: 0; position: absolute; }
.toggle-slider { width: 44px; height: 24px; background: #d1d5db; border-radius: 12px; position: relative; transition: background 0.3s; flex-shrink: 0; }
.toggle-input:checked + .toggle-slider { background: #22c55e; }
.toggle-slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.3s; }
.toggle-input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Compact Slides (smaller ad slider) */
.slides-wrapper-compact { overflow: hidden; border-radius: 16px; }
.compact-slide { height: 90px; border-radius: 16px; overflow: hidden; position: relative; display: flex; align-items: center; }
.compact-slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 60%); }
.compact-slide > * { position: relative; z-index: 1; }

/* dir-ltr utility */
.dir-ltr { direction: ltr; text-align: left; }

/* line-clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
