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

:root {
    --primary: #ffffff;
    --accent: #ff7b2b;
    --bg-dark: #000000;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --glass: rgba(30, 30, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
    --gold-gradient: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    --price-gradient: linear-gradient(135deg, #d4ad7a, #e5b77a, #fcd196);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.hero {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.45) 0%,
            rgba(0, 0, 0, 0.55) 50%,
            rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.user-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.3s ease;
}

.user-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.hero-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 85%;
    max-width: 500px;
}

.hero-logo-img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 60px;
}

.tabs-container {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px 0 20px;
    /* Increased top padding to prevent clipping */
    margin: -40px 15px 25px;
    border-radius: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.tabs {
    display: flex;
    gap: 25px;
    padding: 10px 20px;
    /* Added top/bottom padding to allow glow overflow */
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(191, 149, 63, 0.5) transparent;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: transparent;
    margin: 0 20px;
}

.tabs::-webkit-scrollbar-thumb {
    background: rgba(191, 149, 63, 0.5);
    border-radius: 4px;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    max-width: 80px;
    flex-shrink: 0;
    text-align: center;
}

.tab span {
    display: block;
    margin-top: 8px;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-icon {
    width: 75px;
    height: 75px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    margin: 0 auto;
}

.tab-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.tab-icon.has-image {
    background: transparent;
}

.tab:hover .tab-icon {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.tab.active .tab-icon {
    border: 2px solid #d1a163;
    box-shadow: 0 4px 12px rgba(209, 161, 99, 0.3);
}

.tab.active span {
    color: #d1a163;
    font-weight: 700;
    border-bottom: 2px solid #d1a163;
    padding-bottom: 4px;
}

/* Active tab-icon shadow/bg is handled above */

.view-toggle {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    justify-content: flex-start;
}

.toggle-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--glass-border);
    background: white;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn.active {
    background: var(--primary);
    color: var(--accent);
    border-color: var(--primary);
}

.search-bar {
    margin: 10px 20px 25px;
}

.search-bar input {
    width: 100%;
    padding: 16px 25px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    font-size: 1rem;
    background: var(--card-bg);
    color: #fff;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-bar input:focus {
    outline: none;
    border-color: #bf953f;
    box-shadow: 0 0 0 4px rgba(191, 149, 63, 0.2);
}

main {
    min-height: 400px;
    padding: 0 20px;
}

.loading {
    text-align: center;
    padding: 80px 20px;
    font-size: 1.2rem;
    color: #999;
}

.category-section {
    margin-bottom: 30px;
}

.category-header {
    text-align: left;
    margin-bottom: 25px;
    padding: 10px 0;
    border-bottom: 2px solid #bf953f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    font-family: 'Italiana', serif;
    font-size: 2rem;
    font-weight: 400;
    background: var(--price-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-count {
    background: var(--price-gradient);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dishes-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.dish-item {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dish-item:hover {
    transform: translateY(-8px);
    border-color: #aa771c;
}

.dish-image-container {
    width: 100%;
    height: 180px;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    background: #111;
    border: none;
    position: relative;
}

.dish-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, #000000 0%, transparent 100%);
    z-index: 1;
}

.dish-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.dish-item:hover .dish-image {
    transform: scale(1.1);
}

.dish-favorite {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    color: #fff;
    font-size: 1.2rem;
}

.dish-add {
    position: absolute;
    bottom: 40px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dish-details {
    padding: 20px;
    padding-top: 5px;
    background: #000000;
    flex-grow: 1;
    z-index: 2;
    position: relative;
}

.dish-name {
    font-family: 'Italiana', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #d1a163;
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dish-price {
    background: var(--price-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.sar-symbol {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: var(--price-gradient);
    -webkit-mask: url('image/Saudi_Riyal_Symbol.svg.png') no-repeat center;
    mask: url('image/Saudi_Riyal_Symbol.svg.png') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex-shrink: 0;
}

.dish-description {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-items-message {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    color: #999;
    font-size: 1rem;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .container {
        max-width: 800px;
    }

    .tabs {
        justify-content: flex-start;
    }
}


/* Dish Detail Modal */
.dish-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    overflow-y: auto;
}

.dish-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #111111;
    width: 100%;
    max-width: 500px;
    min-height: auto;
    border-radius: 40px;
    border: 2.5px solid #d1a163;
    position: relative;
    overflow: hidden;
    margin: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    animation: modalAppear 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalAppear {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.modal-details {
    padding: 30px;
    text-align: left;
    background: #111111;
}

.modal-dish-name {
    font-family: 'Italiana', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: #d1a163;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.modal-price-badge {
    display: inline-block;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 25px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--text-muted);
}

.modal-dish-description {
    color: #a0a0a0;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.modal-dish-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--price-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-sar-symbol {
    display: inline-block;
    width: 1.3em;
    height: 1.3em;
    background: var(--price-gradient);
    -webkit-mask: url('image/Saudi_Riyal_Symbol.svg.png') no-repeat center;
    mask: url('image/Saudi_Riyal_Symbol.svg.png') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    flex-shrink: 0;
}

.modal-nav {
    display: none;
    /* Simplify for now or redesign later */
}

.dish-favorite {
    display: none !important;
}