:root {
    /* Y Combinator Brand Colors */
    --primary-color: #ff6600;
    --primary-hover: #e65c00;
    --primary-light: rgba(255, 102, 0, 0.08);
    
    /* YC Light Theme (ycombinator.com Style) */
    --bg-color: #F6F6EF; /* Classic HN off-white cream background */
    --surface-color: #FFFFFF; /* Pure white content panels */
    --sidebar-bg: #F0EFE7; /* Clean sidebar backdrop */
    
    --text-main: #1A1A1A; /* Dark slate reading color */
    --text-muted: #5A5A5A; /* Slate gray muted text */
    --border-color: #E2E2D9; /* Clean cream-gray borders */
    
    --success-color: #10B981;
    --success-light: rgba(16, 185, 129, 0.08);
    --warning-color: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.08);
    --error-color: #EF4444;
    
    /* Clean YC Sharp Radius */
    --radius-sm: 4px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-full: 9999px;
    
    /* Flat YC Borders & Shadows */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: none;
    --transition-bounce: none;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* YC Flat Card */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: #B5B5AC; /* Slight border accentuation, no hover lift */
}

/* Compact Icon Chips (No Glows) */
.glow-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.glow-red { background: rgba(226, 55, 68, 0.15); color: #FF4D5A; border: 1px solid rgba(226, 55, 68, 0.2); }
.glow-green { background: rgba(16, 185, 129, 0.15); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.glow-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }

/* Dashboard Typography */
.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin: 4px 0 0 0;
    text-shadow: 0 0 15px rgba(255,255,255,0.1);
}

/* Layout & Containers */
#app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.view {
    width: 100%;
    height: 100%;
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.hidden {
    display: none !important;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}
.float-anim {
    animation: float 6s ease-in-out infinite;
}

/* Splash Screen */
.portal-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    background: var(--bg-color);
}

.splash-logo h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -1px;
}

.splash-logo p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.portal-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 320px;
}

/* Buttons (Zomato Light Theme) */
button {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #FAF9F6;
    border-color: #B5B5AC;
}

/* Forms & Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-group input, .input-group select, .input-group textarea {
    font-family: var(--font-family);
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: var(--transition);
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    border-color: #3f3f46;
}

/* Header */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation-duration: 1.5s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: shimmer;
    animation-timing-function: linear;
    border-radius: 8px;
}

/* Zomato Style Card Overhaul */
.zomato-menu-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.zomato-menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12) !important;
}

.zomato-menu-card:hover .card-image {
    transform: scale(1.06);
}

/* Mock Phone UI for Customer & Delivery Panels */
.mobile-layout {
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    position: relative;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Desktop UI for Admin */
.desktop-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-color);
}

.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    height: 100vh;
    overflow-y: auto;
}

/* Header */
.app-header {
    background-color: var(--bg-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0 1.5rem 0; /* Extra padding for modern phones */
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Premium Sidebar Nav Item */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav-item:hover {
    background: rgba(255, 102, 0, 0.04);
    color: var(--primary-color);
}

.sidebar-nav-item.active {
    background: rgba(255, 102, 0, 0.08);
    color: var(--primary-color) !important;
    font-weight: 600;
    border-left-color: var(--primary-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Premium Corporate Table */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.premium-table th {
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02); /* Semi-transparent headers */
}

.premium-table th:first-child {
    border-top-left-radius: var(--radius-sm);
}

.premium-table th:last-child {
    border-top-right-radius: var(--radius-sm);
}

.premium-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.premium-table tr:last-child td {
    border-bottom: none;
}

.premium-table tr:hover td {
    background: rgba(0, 0, 0, 0.015);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.modal-content {
    background-color: var(--surface-color);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1), 0 0 30px rgba(255, 102, 0, 0.03);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(226, 55, 68, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(226, 55, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(226, 55, 68, 0); }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 90px; /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.toast {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    animation: slideUpFade 0.3s ease forwards;
}

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

/* Utility tags */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-veg {
    background-color: rgba(36, 150, 63, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(36, 150, 63, 0.3);
}

.tag-nonveg {
    background-color: rgba(226, 55, 68, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(226, 55, 68, 0.3);
}

/* Veg/Nonveg Icons */
.diet-icon {
    width: 16px;
    height: 16px;
    border: 1px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}
.diet-icon::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}
.diet-icon.veg {
    color: var(--success-color);
}
.diet-icon.nonveg {
    color: var(--primary-color);
}

/* Glassmorphism Payment Loading Overlay */
.payment-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 28, 28, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-family);
    animation: fadeIn 0.3s ease;
}

.payment-loader-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0,0,0,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: zoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.payment-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 2rem auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Zomato Redesign Classes */
.z-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.z-hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3));
    z-index: 1;
}

.z-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    width: 90%;
}

.z-navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    color: white;
}

.z-search-bar {
    display: flex;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.z-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    color: var(--secondary-color);
}

.z-category-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.z-category-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.z-category-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.z-category-content {
    padding: 1rem;
}

.z-collection-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 250px;
    cursor: pointer;
}

.z-collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.z-collection-card:hover img {
    transform: scale(1.05);
}

.z-collection-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: white;
}

.z-locality-card {
    background: white;
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--shadow-sm);
}

.z-locality-card:hover {
    box-shadow: var(--shadow-sm);
}

/* =========================================
   CROSS-DEVICE RESPONSIVE OVERHAUL
   ========================================= */

/* Break out of the mock mobile phone layout constraint */
.mobile-layout {
    max-width: 100% !important;
    background: var(--bg-color);
    box-shadow: none !important;
    border-radius: 0 !important;
    min-height: 100vh;
}

/* Constrain internal content so it doesn't stretch infinitely on ultra-wide screens */
#customer-content, #franchise-content, #delivery-content, #admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Auth Screens (Customer Login) */
#login-step-google, #login-step-link {
    max-width: 450px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Desktop & Tablet specific improvements */
@media (min-width: 768px) {
    /* Responsive Grid for Food Menu Cards */
    .zomato-menu-card {
        display: inline-flex;
        width: calc(50% - 1.5rem);
        margin: 0.75rem;
        box-sizing: border-box;
        vertical-align: top;
    }
    
    /* Make the top header look like a proper web header */
    .app-header {
        max-width: 1200px;
        margin: 0 auto;
        border-radius: 0 0 20px 20px;
    }
    
    /* Transform bottom nav into a premium floating macOS-style dock on larger screens */
    .bottom-nav {
        max-width: 500px !important;
        border-radius: 40px !important;
        bottom: 20px !important;
        box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
        border: 1px solid var(--glass-border) !important;
        padding: 1rem 0 !important;
    }
}

@media (min-width: 1100px) {
    /* 3-column grid for larger laptops */
    .zomato-menu-card {
        width: calc(33.333% - 1.5rem);
    }
}

/* Premium Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
