/* ============================================
   RECIPE BOOK - THE PRIVACY APP THEME
   Premium Dark Mode with Glassmorphism
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* ===== PRIMARY COLORS ===== */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --primary-glow: rgba(124, 58, 237, 0.4);

    --secondary: #06b6d4;
    --secondary-light: #22d3ee;

    /* ===== GRADIENT PALETTE ===== */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-surface: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);

    /* ===== BACKGROUND COLORS ===== */
    --bg-base: #0a0f1a;
    --bg-surface: rgba(15, 23, 42, 0.95);
    --bg-elevated: rgba(30, 41, 59, 0.85);
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-input: rgba(51, 65, 85, 0.5);
    --bg-hover: rgba(124, 58, 237, 0.1);

    /* ===== TEXT COLORS ===== */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-disabled: #475569;

    /* ===== STATUS COLORS ===== */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;

    /* ===== BORDERS & DIVIDERS ===== */
    --border-subtle: rgba(148, 163, 184, 0.1);
    --border-default: rgba(148, 163, 184, 0.2);
    --border-focus: rgba(124, 58, 237, 0.5);

    /* ===== ELEVATION (SHADOWS) ===== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --shadow-glow-sm: 0 0 10px var(--primary-glow);

    /* ===== GLASSMORPHISM ===== */
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);

    /* ===== SPACING & SIZING ===== */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== GLOBAL RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
}

p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ===== LINKS ===== */
a {
    color: var(--primary-light);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--secondary-light);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(10, 15, 26, 0.95);
    box-shadow: var(--shadow-lg);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    max-width: 1280px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

/* Global Search */
.search-global {
    position: relative;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.navbar .search-global input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.navbar .search-global input::placeholder {
    color: var(--text-muted);
}

.navbar .search-global input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(51, 65, 85, 0.7);
}

.search-global::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ===== CARDS ===== */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-lg), var(--shadow-glow-sm);
    transform: translateY(-4px);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.card-link {
    text-decoration: none;
    display: block;
}

.card-link:hover {
    color: inherit;
}

/* Recipe Cards Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recipe-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.recipe-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.recipe-card .card-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.recipe-card .card-info span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.recipe-card .card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.badge-cuisine {
    background: rgba(6, 182, 212, 0.2);
    color: var(--secondary-light);
    border-color: rgba(6, 182, 212, 0.3);
}

.badge-meal {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge-breakfast {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning-light);
    border-color: rgba(251, 191, 36, 0.3);
}

.badge-lunch {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.badge-dinner {
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary-light);
    border-color: rgba(139, 92, 246, 0.3);
}

.badge-snack {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.3);
}

/* ===== BUTTONS ===== */
.btn {
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
    color: white;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow-sm);
    color: var(--text-primary);
}

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

.btn-success:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
    color: white;
}

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

.btn-danger:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-warning {
    background: var(--gradient-warning);
    color: #1a1a2e;
}

.btn-warning:hover {
    box-shadow: var(--shadow-lg), 0 0 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-outline-warning {
    border-color: rgba(245, 158, 11, 0.5);
    color: var(--warning-light);
}

.btn-outline-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--danger-light);
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* ===== FORMS ===== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    width: 100%;
    transition: all var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-glow-sm);
    background: rgba(51, 65, 85, 0.7);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: var(--text-muted);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.9375rem;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-form .form-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.filter-form .btn {
    flex-shrink: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn var(--transition-normal) ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-light);
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-light);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning-light);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.alert-dismissible {
    position: relative;
    padding-right: 3rem;
}

.alert .btn-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
}

/* ===== RECIPE DETAIL ===== */
.recipe-detail {
    max-width: 900px;
    margin: 0 auto;
}

.recipe-header {
    margin-bottom: 2rem;
}

.recipe-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.recipe-header .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recipe-section {
    margin-bottom: 2rem;
}

.recipe-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-section-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    white-space: pre-line;
    color: var(--text-secondary);
    line-height: 1.8;
}

.recipe-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ===== SEARCH RESULTS ===== */
.search-results-header {
    margin-bottom: 2rem;
}

.search-results-header h1 {
    font-size: 1.75rem;
}

.search-results-header .query {
    color: var(--secondary-light);
}

.search-results-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

.animate-fadeIn {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-fadeInUp {
    animation: fadeInUp var(--transition-slow) ease-out;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE - MOBILE OPTIMIZED ===== */
@media (max-width: 768px) {

    /* Navigation - Hamburger on right, search below */
    .navbar {
        padding: 0.75rem 1rem;
    }

    .navbar .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .navbar-brand {
        font-size: 1.25rem;
        order: 1;
    }

    .navbar-brand img {
        height: 28px;
        width: 28px;
    }

    /* Hamburger menu - far right */
    .nav-toggle {
        display: flex;
        order: 2;
        padding: 0.625rem;
        margin-left: auto;
    }

    /* Search bar - full width on its own line */
    .search-global {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0.75rem 0 0;
        flex-basis: 100%;
    }

    .navbar .search-global input {
        padding: 0.625rem 1rem 0.625rem 2.25rem;
        font-size: 0.9375rem;
        width: 100%;
    }

    /* Nav links dropdown */
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.25rem;
        order: 4;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-subtle);
        margin-top: 0.75rem;
        flex-basis: 100%;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .nav-toggle {
        display: flex;
        padding: 0.625rem;
    }

    /* Container - Tighter padding */
    .container {
        padding: 0 0.875rem 1.25rem;
    }

    /* Typography - Mobile optimized */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    /* Page Header - Stack vertically */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    /* Cards - Less padding, tighter */
    .card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .recipe-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.25rem;
    }

    .recipe-card .card-title {
        font-size: 1.125rem;
    }

    .recipe-card .card-info {
        font-size: 0.8125rem;
        gap: 0.75rem;
    }

    /* Forms - Better touch targets */
    .form-container {
        padding: 0;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    label {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    textarea {
        min-height: 100px;
    }

    .filter-form {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-form .form-group {
        width: 100%;
    }

    .filter-bar {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    /* Recipe Detail - Mobile spacing */
    .recipe-header h1 {
        font-size: 1.75rem;
    }

    .recipe-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-box {
        padding: 0.75rem;
    }

    .stat-box .stat-value {
        font-size: 1.25rem;
    }

    .stat-box .stat-label {
        font-size: 0.6875rem;
    }

    .recipe-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .recipe-section h2 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    /* Form Rows - Stack on mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.625rem;
    }

    .checkbox-item {
        padding: 0.25rem 0;
    }

    .checkbox-item label {
        font-size: 0.9375rem;
    }

    /* Buttons - Full width on mobile */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }

    .btn-sm {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .recipe-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Badges - Smaller on mobile */
    .badge {
        padding: 0.1875rem 0.5rem;
        font-size: 0.6875rem;
    }

    /* Alerts - Compact */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    /* Footer - Compact */
    .footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-links {
        font-size: 0.8125rem;
    }

    /* Auth pages */
    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .recipe-stats {
        grid-template-columns: 1fr;
    }

    .recipe-actions {
        flex-direction: column;
    }

    .recipe-actions .btn {
        width: 100%;
    }
}

/* ===== NAV DROPDOWN ===== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 0.5rem 0;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-logo-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.footer-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-divider {
    color: var(--text-muted);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== AUTH PAGES ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    color: var(--text-muted);
    margin: 0;
}

.auth-legal {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-legal p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

.auth-divider span {
    padding: 0 1rem;
}

.google-signin-container {
    margin-bottom: 1rem;
}

.g_id_signin {
    display: flex;
    justify-content: center;
}

.btn-full {
    width: 100%;
}

.checkbox-row {
    margin: 1rem 0;
}

/* ===== PRIVACY TOGGLE ===== */
.privacy-toggle {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.toggle-option {
    display: flex;
    align-items: center;
}

.toggle-input {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    width: 50px;
    height: 26px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all var(--transition-fast);
}

.toggle-input:checked+.toggle-label .toggle-switch {
    background: var(--gradient-primary);
}

.toggle-input:checked+.toggle-label .toggle-switch::after {
    left: 27px;
    background: white;
}

.toggle-private,
.toggle-public {
    font-weight: 500;
    transition: all var(--transition-fast);
}

.toggle-private {
    color: var(--text-muted);
}

.toggle-public {
    color: var(--text-muted);
}

.toggle-input:not(:checked)+.toggle-label .toggle-private {
    color: var(--danger-light);
}

.toggle-input:checked+.toggle-label .toggle-public {
    color: var(--success-light);
}

.toggle-help {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.help-private,
.help-public {
    display: none;
    color: var(--text-muted);
}

.toggle-input:not(:checked)~.toggle-help .help-private {
    display: block;
}

.toggle-input:checked~.toggle-help .help-public {
    display: block;
}

/* ===== LEGAL PAGES ===== */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.legal-card {
    padding: 2.5rem;
}

.legal-card h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.legal-section h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.legal-section p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.legal-section ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.legal-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* ===== COLLECTIONS ===== */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.collection-card {
    text-align: center;
    padding: 2rem;
}

.collection-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.collection-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.collection-meta {
    margin-top: 1rem;
}

.card-collections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.badge-collection {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-light);
    border-color: rgba(124, 58, 237, 0.3);
}

.badge-collection-small {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-full);
}

.recipe-collections {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== ADDITIONAL BADGES ===== */
.badge-public {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge-private {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.3);
}

.badge-author {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

/* ===== SHARE LINK ===== */
.share-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-top: 2rem;
}

.share-section h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
}

.share-link-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

/* ===== PAGE SUBTITLE ===== */
.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== DIET TYPE BADGES ===== */
.badge-veg {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-egg {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-nonveg {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===== DIET TYPE TOGGLE (for forms) ===== */
.diet-toggle {
    display: flex;
    gap: 0;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-default);
    background: var(--bg-input);
}

.diet-toggle input[type="radio"] {
    display: none;
}

.diet-toggle label {
    flex: 1;
    padding: 0.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    border-right: 1px solid var(--border-default);
    margin-bottom: 0;
}

.diet-toggle label:last-of-type {
    border-right: none;
}

.diet-toggle label:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.diet-toggle input[type="radio"]:checked+label {
    color: white;
    font-weight: 600;
}

.diet-toggle input#diet_veg:checked+label {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.diet-toggle input#diet_egg:checked+label {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.diet-toggle input#diet_non_veg:checked+label {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* ===== FILTER PILLS ===== */
.filter-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-pills-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-pills-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-pills {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
}

.pill:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
    color: var(--text-primary);
}

.pill.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow-sm);
}

/* Diet type pills - active states */
.pill-veg.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.pill-egg.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.pill-nonveg.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Meal type pills - active states */
.pill-breakfast.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a2e;
}

.pill-lunch.active {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.pill-dinner.active {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

.pill-snack.active {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

/* ===== ENHANCED FILTER BAR ===== */
.filter-bar-enhanced {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.filter-bar-enhanced .search-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-bar-enhanced .search-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.filter-bar-enhanced .filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Responsive filter bar */
@media (max-width: 768px) {
    .filter-pills-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-pills-group {
        flex-wrap: wrap;
    }

    .filter-bar-enhanced .search-row {
        flex-direction: column;
    }

    .diet-toggle {
        flex-direction: column;
    }

    .diet-toggle label {
        border-right: none;
        border-bottom: 1px solid var(--border-default);
    }

    .diet-toggle label:last-of-type {
        border-bottom: none;
    }
}

/* ===== ADMIN DASHBOARD ===== */
.admin-page {
    padding-bottom: 2rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

.admin-subtitle {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.admin-login-card {
    width: 100%;
    max-width: 400px;
}

.admin-login-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.admin-section h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: var(--bg-elevated);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-focus);
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-card.highlight .metric-value {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card.status-healthy {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.metric-card.status-healthy .metric-value {
    color: var(--success);
}

.metric-card.status-degraded {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.metric-card.status-degraded .metric-value {
    color: var(--danger);
}

/* Admin Tables */
.admin-table-container {
    overflow-x: auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-default);
}

.admin-table th {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

.admin-table tbody tr:hover {
    background: var(--bg-hover);
}

.monospace {
    font-family: 'SF Mono', 'Roboto Mono', 'Menlo', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.backup-message {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.backup-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-light);
}

.backup-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

.backup-row-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 2rem;
}