:root {
    --primary: #D4AF37;
    --primary-dark: #b8860b;
    --bg-dark: #0A0A0B;
    --bg-surface: #141415;
    --bg-surface-hover: #1A1A1B;
    --border-color: #222223;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --danger: #EF4444;
    --success: #10B981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Restrict App to Mobile Width on Desktop */
.mobile-app {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    z-index: 1;
}

/* Smoke Effect */
.smoke-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.smoke {
    position: absolute;
    bottom: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
    filter: blur(30px);
}
.smoke.left-1 { left: -50px; animation: rise 15s infinite ease-in-out; }
.smoke.right-1 { right: -50px; animation: rise 18s infinite ease-in-out 5s; }

@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    border-bottom: 1px solid var(--border-color);
}
.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}
.brand i { margin-right: 6px; }

.user-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}
.icon-btn {
    color: var(--text-primary);
    font-size: 1.25rem;
    text-decoration: none;
    opacity: 0.8;
}
.login-text {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg-surface);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}
.login-text:active { background: var(--bg-surface-hover); }
.login-text i { margin-right: 4px; }

/* Banner */
.banner {
    padding: 24px 20px 20px;
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.08) 0%, transparent 100%);
}
.banner h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.banner p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Categories (Horizontal Scroll) */
.categories {
    display: flex;
    overflow-x: auto;
    padding: 0 20px 16px 20px;
    gap: 8px;
    scrollbar-width: none; /* Firefox */
}
.categories::-webkit-scrollbar { display: none; /* Chrome/Safari */ }

.cat-pill {
    padding: 8px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.cat-pill.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    font-weight: 600;
}

/* Menu List */
.menu-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-list-item {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    gap: 16px;
    transition: background 0.2s;
}
.menu-list-item:active {
    background: var(--bg-surface-hover);
}

.item-img-wrapper {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.item-img-placeholder {
    color: #333;
    font-size: 2rem;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}
.item-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.bottom-spacer {
    height: 80px;
}

/* -----------------------------
   Forms & Auth & Admin Fallbacks
   ----------------------------- */

/* Shared Form Styles */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
input, textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem; /* >=16px prevents iOS zoom */
    outline: none;
    transition: border-color 0.2s;
}
input:focus, textarea:focus {
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
}
.btn-primary {
    background: var(--primary);
    color: #000;
}
.btn-primary:active {
    background: var(--primary-dark);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Auth Pages Wrapper */
.auth-page {
    background: #000;
    align-items: center;
}
.auth-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-box h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}
.auth-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}
.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Admin Layout (Responsive Desktop Override) */
.admin-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    .admin-layout { flex-direction: row; min-height: 100vh; }
}

.admin-sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}
@media (min-width: 768px) { .admin-sidebar { width: 250px; } }

.admin-sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }
.admin-sidebar-header h3 { color: var(--primary); }

.admin-nav ul { list-style: none; }
.admin-nav li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}
.admin-nav li a.active, .admin-nav li a:hover {
    color: var(--primary);
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid var(--primary);
}

.admin-content {
    flex: 1;
    padding: 20px;
}
@media (min-width: 768px) { .admin-content { padding: 40px; } }

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

.glass-effect {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.admin-table th { color: var(--primary); font-weight: 600; }
