/* ============================================================
   Eetclub Nimma - Stylesheet
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
    --primary:        #D4622A;
    --primary-dark:   #B5501F;
    --primary-light:  #F4A87A;
    --secondary:      #2D5016;
    --secondary-light:#4A7C2F;
    --accent:         #F0C040;
    --bg:             #FDF6EE;
    --bg-card:        #FFFFFF;
    --text:           #2C1A0E;
    --text-muted:     #7A6A5A;
    --border:         #E8D8C4;
    --border-focus:   #D4622A;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 2px 16px rgba(44, 26, 14, 0.10);
    --shadow-lg:      0 8px 40px rgba(44, 26, 14, 0.16);
    --nav-h:          68px;
    --transition:     0.2s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.main-content { flex: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
textarea, input, select { font-family: inherit; }

/* ---- Layout ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 60px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.section-header h2 { font-size: 1.75rem; color: var(--text); }
.section-link { color: var(--primary); font-weight: 600; }

/* ---- Navbar ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border);
    height: var(--nav-h);
    box-shadow: 0 1px 8px rgba(44,26,14,0.07);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.brand-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
    flex-shrink: 0;
}
.brand-text { font-size: 1.15rem; font-weight: 700; }
.brand-text em { font-style: normal; color: var(--primary); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    background: none;
    transition: background var(--transition), color var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-link.nav-cta {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.nav-link.nav-cta:hover { background: var(--primary-dark); color: #fff; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    display: none;
    z-index: 200;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu li a {
    display: block;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    transition: background var(--transition);
}
.dropdown-menu li a:hover { background: var(--bg); }
.dropdown-menu .dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-danger { color: #dc2626 !important; }

.nav-avatar, .nav-avatar-placeholder {
    width: 26px; height: 26px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-avatar-placeholder {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition);
}

/* ---- Flash Messages ---- */
.flash {
    padding: 14px 0;
}
.flash .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--radius);
    padding: 14px 20px;
    font-weight: 500;
}
.flash-success .container { background: #d1fae5; color: #065f46; }
.flash-error .container   { background: #fee2e2; color: #991b1b; }
.flash-close {
    background: none; border: none;
    font-size: 1.3rem; cursor: pointer; opacity: 0.6;
    line-height: 1;
    flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a3a0a 100%);
    min-height: 520px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 60px 20px;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 32px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    gap: 32px;
}
.stat { color: rgba(255,255,255,0.9); }
.stat strong { display: block; font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat span   { font-size: 0.85rem; opacity: 0.7; }

.hero-visual {
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    height: 600px;
    pointer-events: none;
}
.hero-circles { position: relative; width: 100%; height: 100%; }
.circle {
    position: absolute;
    border-radius: 50%;
}
.c1 { width: 400px; height: 400px; background: rgba(212,98,42,0.15); top: 50px; right: 80px; }
.c2 { width: 280px; height: 280px; background: rgba(212,98,42,0.10); top: 150px; right: 0; }
.c3 { width: 160px; height: 160px; background: rgba(212,98,42,0.20); top: 80px; right: 200px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; }
.btn-large { padding: 13px 28px; font-size: 1rem; }
.btn-sm    { padding: 7px 14px; font-size: 0.85rem; }
.btn-full  { width: 100%; }

/* ---- Theme Chips ---- */
.theme-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.theme-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 100px;
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    text-decoration: none;
}
.theme-chip:hover, .theme-chip-all {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.chip-count {
    background: var(--bg);
    border-radius: 100px;
    padding: 1px 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.theme-chip:hover .chip-count, .theme-chip-all .chip-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ---- Recipe Grid & Cards ---- */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.recipe-grid-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.recipe-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}
.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg);
}
.card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.recipe-card:hover .card-image img { transform: scale(1.04); }
.card-image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f5e6d0, #e8d0b0);
}
.card-image-placeholder span {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.5;
}
.card-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.card-badge-private { background: #6b7280; left: auto; right: 10px; }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.card-meta  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    color: var(--text-muted);
}
.card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.card-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: auto;
}
.card-time, .card-servings, .card-date, .card-author-sm {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.mini-avatar, .mini-avatar-placeholder {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.mini-avatar-placeholder {
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Recipe card wrapper (my-recipes) ---- */
.recipe-card-wrapper { display: flex; flex-direction: column; gap: 8px; }
.card-actions { display: flex; gap: 8px; }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.empty-state h3 { font-size: 1.3rem; color: var(--text); }
.empty-state p  { color: var(--text-muted); }

/* ---- CTA Section ---- */
.cta-section { padding: 60px 0; }
.cta-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 60px 48px;
    text-align: center;
    color: #fff;
}
.cta-box h2   { font-size: 2rem; margin-bottom: 12px; }
.cta-box p    { opacity: 0.85; font-size: 1.05rem; margin-bottom: 28px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-actions  { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.cta-box .btn-outline { border-color: rgba(255,255,255,0.6); color: #fff; }
.cta-box .btn-outline:hover { background: #fff; color: var(--primary); border-color: #fff; }

/* ---- Auth Pages ---- */
.auth-page {
    min-height: calc(100vh - var(--nav-h) - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.auth-header h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-header p  { color: var(--text-muted); }
.auth-form      { display: flex; flex-direction: column; gap: 16px; }
.auth-switch    { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 0.9rem; }

/* ---- Forms ---- */
.form-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 2rem; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.required { color: var(--primary); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select,
.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus, .form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(212,98,42,0.12);
}
textarea { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-select { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%237A6A5A' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; cursor: pointer; }

.form-error-box {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    color: #991b1b;
    margin-bottom: 24px;
    font-size: 0.9rem;
}
.form-error-box ul { padding-left: 20px; margin-top: 6px; }

.form-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 8px 0 40px;
}

/* ---- Password toggle ---- */
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 44px; }
.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex; align-items: center;
    transition: color var(--transition);
}
.pwd-toggle:hover { color: var(--primary); }

/* ---- Image Upload ---- */
.upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition);
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-area:hover { border-color: var(--primary); }
.upload-area-sm { min-height: 100px; }
.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100% !important;
    height: 100%;
    z-index: 2;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    pointer-events: none;
    padding: 24px;
    text-align: center;
}
.upload-placeholder svg { opacity: 0.5; }
.upload-placeholder p { font-weight: 500; }
.upload-placeholder span { font-size: 0.8rem; }
.upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 1;
}
.current-image { margin-bottom: 12px; }
.current-image-preview { border-radius: var(--radius-sm); max-height: 200px; width: auto; }

/* ---- Ingredient rows ---- */
.ingredient-row {
    display: grid;
    grid-template-columns: 90px 130px 1fr 36px;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--bg);
}
.step-row {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg);
}
.step-number {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}
.step-textarea { min-height: 60px; }
.btn-remove-row {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-remove-row:hover { background: #fee2e2; border-color: #dc2626; color: #dc2626; }

/* ---- Toggle switch ---- */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}
.toggle-input { display: none; }
.toggle-slider {
    width: 48px; height: 26px;
    border-radius: 100px;
    background: #d1d5db;
    position: relative;
    flex-shrink: 0;
    transition: background var(--transition);
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-input:checked + .toggle-slider { background: var(--primary); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(22px); }
.toggle-text { font-weight: 500; }

/* ---- Search Page ---- */
.search-page { padding: 40px 0; }
.search-form { margin-bottom: 32px; }
.search-bar-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.search-bar {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}
.search-bar svg {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}
.search-input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: #fff;
    outline: none;
    transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(212,98,42,0.12); }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.btn-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: underline;
    margin-top: 8px;
}
.results-header { margin-bottom: 20px; }
.results-count  { color: var(--text-muted); font-size: 0.9rem; }

/* ---- Suggestions ---- */
.suggestion-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.suggestion-box h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text); }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion-chip {
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    transition: all var(--transition);
    text-decoration: none;
}
.suggestion-chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Autocomplete ---- */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}
.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--transition);
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--bg); }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.page-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Filter tabs ---- */
.filter-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 28px;
}
.filter-tab {
    padding: 10px 20px;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}
.filter-tab:hover, .filter-tab.active { color: var(--primary); border-color: var(--primary); }

/* ---- Recipe View Page ---- */
.recipe-view-page {}

.recipe-hero {
    position: relative;
    background: linear-gradient(135deg, #3a1a06, #1a0800);
    padding: 60px 0 40px;
    overflow: hidden;
}
.recipe-hero-bg {
    position: absolute;
    inset: 0;
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: blur(2px);
    transform: scale(1.05);
}
.recipe-hero-content {
    position: relative;
    z-index: 1;
}
.recipe-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.recipe-breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.recipe-breadcrumb a:hover { color: #fff; }
.recipe-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.2;
}
.recipe-meta-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.recipe-author-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
.recipe-author-avatar, .recipe-author-initials {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    object-fit: cover;
}
.recipe-author-initials {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
}
.recipe-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    font-size: 0.82rem;
    border: 1px solid rgba(255,255,255,0.25);
    text-decoration: none;
}
.recipe-date { color: rgba(255,255,255,0.6); font-size: 0.82rem; }

.recipe-body { padding: 48px 0; }

.recipe-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
}

.recipe-section { margin-bottom: 40px; }
.recipe-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
    color: var(--text);
}

.section-header-with-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
    gap: 16px;
    flex-wrap: wrap;
}
.section-header-with-control h2 { margin: 0; padding: 0; border: none; }

/* ---- Servings Control ---- */
.servings-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.servings-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.servings-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
#servingsDisplay {
    min-width: 32px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ---- Ingredients list ---- */
.ingredients-list { display: flex; flex-direction: column; gap: 0; }
.ingredient-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bg);
    font-size: 0.95rem;
}
.ingredient-item:last-child { border-bottom: none; }
.ing-amount-display {
    min-width: 100px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.ing-name-display { color: var(--text); }

/* ---- Steps list ---- */
.steps-list { display: flex; flex-direction: column; gap: 0; list-style: none; counter-reset: steps; }
.step-item {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--bg);
}
.step-item:last-child { border-bottom: none; }
.step-number-badge {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.step-text { flex: 1; line-height: 1.7; padding-top: 6px; }

/* ---- Times ---- */
.recipe-times {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
}
.time-block {
    display: flex;
    align-items: center;
    gap: 12px;
}
.time-block svg { color: var(--primary); }
.time-block > div { display: flex; flex-direction: column; }
.time-label { font-size: 0.78rem; color: var(--text-muted); }
.time-block strong { font-size: 1rem; color: var(--text); }
.time-block-total strong { color: var(--primary); }

/* ---- Recipe intro ---- */
.recipe-intro {
    background: var(--bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 20px 24px;
    margin-bottom: 32px;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ---- Share buttons ---- */
.share-section h2 { margin-bottom: 16px; }
.share-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
}
.share-whatsapp  { background: #25D366; color: #fff; }
.share-whatsapp:hover { background: #1ebe5d; color: #fff; }
.share-instagram { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: #fff; }
.share-instagram:hover { opacity: 0.9; }
.share-copy      { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.share-copy:hover { background: var(--bg); }

/* ---- Recipe sidebar ---- */
.recipe-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-image { border-radius: var(--radius); overflow: hidden; }
.sidebar-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sidebar-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); }

.chef-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.chef-avatar, .chef-avatar-placeholder {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.chef-avatar-placeholder {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.chef-info p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.owner-actions { gap: 10px; }

.shared-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}
.shared-status.shared  { background: #d1fae5; color: #065f46; }
.shared-status.private { background: #f3f4f6; color: #6b7280; }

/* ---- Related Recipes ---- */
.related-recipes { margin-top: 40px; }

/* ---- Profile Page ---- */
.profile-page { padding: 40px 0; }
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}
.profile-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}
.profile-avatar-section { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.profile-avatar, .profile-avatar-placeholder {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.profile-avatar-placeholder {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 2rem;
    display: flex; align-items: center; justify-content: center;
}
.profile-avatar-section h2  { font-size: 1.2rem; }
.profile-email  { font-size: 0.85rem; color: var(--text-muted); }
.profile-since  { font-size: 0.8rem; color: var(--text-muted); }
.profile-stats  { display: flex; justify-content: center; gap: 24px; }
.pstat          { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pstat strong   { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.pstat span     { font-size: 0.78rem; color: var(--text-muted); }
.profile-forms  { display: flex; flex-direction: column; gap: 24px; }
.profile-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.profile-card h3 { font-size: 1.1rem; font-weight: 700; }
.profile-form { display: flex; flex-direction: column; gap: 16px; }

/* ---- Footer ---- */
.site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.8);
    padding: 48px 0 24px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-brand .brand-icon { background: var(--primary); }
.footer-brand .brand-text { color: #fff; }
.footer-brand .brand-text em { color: var(--primary-light); }
.footer-brand p { font-size: 0.88rem; color: rgba(255,255,255,0.55); max-width: 300px; line-height: 1.6; }
.footer-links h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.9rem; color: rgba(255,255,255,0.6); transition: color var(--transition); }
.footer-links a:hover { color: var(--primary-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 0.82rem; color: rgba(255,255,255,0.4); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .recipe-layout { grid-template-columns: 1fr; }
    .recipe-sidebar { order: -1; }
    .sidebar-image  { display: none; }
    .profile-layout { grid-template-columns: 1fr; }
    .footer-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .nav-links {
        position: fixed;
        inset: var(--nav-h) 0 0 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 4px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--transition);
        border-top: 1px solid var(--border);
    }
    .nav-links.open   { transform: translateX(0); }
    .nav-toggle       { display: flex; }
    .nav-dropdown .dropdown-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 16px; }
    .nav-dropdown:hover .dropdown-menu { display: none; }
    .nav-dropdown.open .dropdown-menu  { display: block; }
    .nav-dropdown-toggle svg { transition: transform var(--transition); }
    .nav-dropdown.open .nav-dropdown-toggle svg { transform: rotate(180deg); }

    .hero { padding: 40px 20px; min-height: auto; }
    .hero-visual { display: none; }
    .hero-actions { flex-direction: column; }
    .hero-stats { gap: 20px; }

    .form-row { grid-template-columns: 1fr; }
    .ingredient-row { grid-template-columns: 70px 110px 1fr 32px; }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .search-bar-group { flex-direction: column; }
    .cta-box { padding: 40px 24px; }
    .auth-card { padding: 32px 24px; }
    .form-page { padding: 24px 16px; }
    .recipe-body { padding: 32px 0; }
    .recipe-times { flex-wrap: wrap; gap: 16px; }
    .share-buttons { flex-direction: column; }
    .share-btn { justify-content: center; }
    .section { padding: 40px 0; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
    .ingredient-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
    .ingredient-row .ing-amount { grid-column: 1; }
    .ingredient-row .ing-unit   { grid-column: 2; }
    .ingredient-row .ing-name   { grid-column: 1 / -1; }
    .ingredient-row .btn-remove-row { grid-column: 2; justify-self: end; }
    .filter-grid { grid-template-columns: 1fr; }
    .recipe-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   Admin Beheer Stijlen
   ============================================================ */

/* ---- Admin subnav ---- */
.admin-subnav {
    background: var(--secondary);
    border-bottom: 2px solid rgba(255,255,255,0.1);
    position: sticky;
    top: var(--nav-h);
    z-index: 90;
}
.admin-subnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 0;
    height: 48px;
}
.admin-subnav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.15);
    margin-right: 8px;
    white-space: nowrap;
}
.admin-subnav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.admin-subnav-link {
    padding: 6px 14px;
    border-radius: 6px;
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.admin-subnav-link:hover { background: rgba(255,255,255,0.12); color: #fff; }
.admin-subnav-link.active { background: var(--primary); color: #fff; }
.admin-subnav-back {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    transition: color var(--transition);
    margin-left: auto;
}
.admin-subnav-back:hover { color: #fff; }

/* ---- Admin page layout ---- */
.admin-page {
    padding: 36px 0 60px;
    min-height: calc(100vh - var(--nav-h) - 48px);
}
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.admin-page-header h1 { font-size: 1.6rem; color: var(--text); }
.admin-count {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
}
.admin-section-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 40px 0;
}

/* ---- Admin grid layouts ---- */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.admin-card-full { grid-column: 1 / -1; }

.admin-grid-sidebar {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}
.admin-sidebar-col { display: flex; flex-direction: column; gap: 20px; }
.admin-main-col    {}

/* ---- Admin cards ---- */
.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}
.admin-card-header h2 { font-size: 0.95rem; font-weight: 700; color: var(--text); }

/* ---- Admin form ---- */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}
.admin-form-actions {
    display: flex;
    gap: 8px;
    padding-top: 4px;
}
.admin-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Admin tables ---- */
.admin-table-scroll { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.admin-table thead { background: #f7f7f7; }
.admin-table th {
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.admin-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--bg);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafafa; }
.admin-row-active { background: #fff8f5 !important; outline: 2px solid var(--primary-light); }
.admin-td-muted   { color: var(--text-muted); }
.admin-td-narrow  { width: 50px; }
.admin-actions-cell {
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

/* ---- Admin badges ---- */
.admin-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.admin-badge-green  { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.admin-badge-grey   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.admin-badge-orange { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }

/* ---- Flavor badge ---- */
.admin-flavor-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #ddd6fe;
}

/* ---- Admin quick links ---- */
.admin-quick-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.admin-quick-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1.5px solid var(--border);
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    text-decoration: none;
}
.admin-quick-btn:hover { border-color: var(--primary); color: var(--primary); background: #fff8f5; }

/* ---- Admin stats ---- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.admin-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-stat-primary { border-color: var(--primary); background: #fff8f5; }
.astat-value  { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.admin-stat-card:not(.admin-stat-primary) .astat-value { color: var(--text); }
.astat-label  { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.astat-sub    { font-size: 0.78rem; color: var(--text-muted); }

/* ---- Admin filter active label ---- */
.admin-filter-active {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

/* ---- Dropdown admin link ---- */
.dropdown-admin { color: var(--secondary) !important; font-weight: 600; }

/* ---- Admin responsive ---- */
@media (max-width: 900px) {
    .admin-grid-2       { grid-template-columns: 1fr; }
    .admin-grid-sidebar { grid-template-columns: 1fr; }
    .admin-card-full    { grid-column: auto; }
}
@media (max-width: 700px) {
    .admin-subnav-label { display: none; }
    .admin-subnav-link  { padding: 6px 10px; font-size: 0.82rem; }
    .admin-stats-grid   { grid-template-columns: repeat(2, 1fr); }
}
