/* ============================================
   LOCALBITES - SHARED STYLES
   All pages use this single CSS file
============================================ */

:root {
    --primary: #22C55E;
    --primary-dark: #16A34A;
    --primary-light: #DCFCE7;
    --secondary: #0F172A;
    --accent: #F97316;
    --accent-light: #FFEDD5;
    --purple: #8B5CF6;
    --purple-light: #EDE9FE;
    --pink: #EC4899;
    --cyan: #06B6D4;
    --cyan-light: #CFFAFE;
    --blue: #3B82F6;
    --blue-light: #DBEAFE;
    --red: #EF4444;
    --red-light: #FEE2E2;
    --yellow: #F59E0B;
    --yellow-light: #FEF3C7;
    --cream: #FEF7ED;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    
    --gradient-green: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --gradient-warm: linear-gradient(135deg, #FEF7ED 0%, #FDF4E7 100%);
    --gradient-ai: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 25px 50px rgba(0,0,0,0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    
    --sidebar-width: 280px;
    --header-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

.display-font {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

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

.btn-secondary:hover {
    background: #1e293b;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text);
}

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

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ============================================
   FORMS
============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   CARDS
============================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

/* ============================================
   BADGES
============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-purple {
    background: var(--purple-light);
    color: var(--purple);
}

/* ============================================
   HEADER (Main Site)
============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-green);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.logo-text span {
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 18px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--background);
    color: var(--primary);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

/* ============================================
   SIDEBAR (Partner Portal)
============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-hero);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.restaurant-brand {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(10px);
}

.restaurant-logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--gradient-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.restaurant-name {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.restaurant-cuisine {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.open {
    background: rgba(34, 197, 94, 0.2);
    color: #4ADE80;
}

.status-badge.closed {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sidebar-nav {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    padding: 8px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: var(--gradient-green);
    color: var(--secondary);
    font-weight: 600;
}

.nav-item-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    padding: 4px 10px;
    background: var(--red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.owner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
}

.owner-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.owner-info {
    flex: 1;
}

.owner-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.owner-role {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

/* ============================================
   MAIN WRAPPER (Partner Portal)
============================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.portal-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.main-content {
    padding: 32px;
}

/* ============================================
   STATS
============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.green::before { background: var(--gradient-green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.purple::before { background: var(--purple); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-card.green .stat-icon { background: var(--primary-light); }
.stat-card.blue .stat-icon { background: var(--blue-light); }
.stat-card.yellow .stat-icon { background: var(--yellow-light); }
.stat-card.purple .stat-icon { background: var(--purple-light); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ============================================
   RESTAURANT CARDS (Main Site)
============================================ */
.restaurant-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
}

.restaurant-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.restaurant-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

.restaurant-card:hover .restaurant-image {
    transform: scale(1.08);
}

.restaurant-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
}

.restaurant-badge {
    padding: 6px 12px;
    background: white;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.restaurant-badge.featured {
    background: var(--accent);
    color: white;
}

.restaurant-rating {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.restaurant-body {
    padding: 24px;
}

.restaurant-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--secondary);
}

.restaurant-card-cuisine {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.restaurant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.restaurant-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ============================================
   MODALS
============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-2xl);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

.modal-header {
    padding: 32px 32px 0;
    text-align: center;
}

.modal-logo {
    width: 64px;
    height: 64px;
    background: var(--gradient-green);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.modal-body {
    padding: 32px;
}

.modal-tabs {
    display: flex;
    margin-bottom: 24px;
    background: var(--background);
    border-radius: var(--radius-md);
    padding: 4px;
}

.modal-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.modal-tab.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--secondary);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--primary); }
.toast.error { background: var(--red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .nav { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .main-content { padding: 20px; }
    .header-container { padding: 0 20px; }
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active { display: block; }
