/**
 * Digitales Rezeptbuch - Main Stylesheet
 * Mobile-First Responsive Design with Dark Mode
 */

/* ============================================
   CSS VARIABLES - LIGHT MODE (Default)
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #e85d4c;
    --primary-dark: #d14836;
    --primary-light: #ff7b6b;
    --primary-rgb: 232, 93, 76;
    --secondary: #1a1a2e;
    --secondary-light: #16213e;
    --accent: #ff6b6b;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Light Mode Colors */
    --white: #ffffff;
    --black: #000000;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Theme Variables (Light Mode) */
    --text: #1e293b;
    --text-light: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.9);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --glow: rgba(232, 93, 76, 0.15);
    
    /* Typography */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius - More modern, rounded */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Shadows - Softer, modern */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 64px;
    --container-max: 1200px;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
    --text: #f1f5f9;
    --text-light: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #1e293b;
    --header-bg: rgba(15, 23, 42, 0.95);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --glow: rgba(232, 93, 76, 0.2);
    
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --white: #1e293b;
}

/* Auto Dark Mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text: #f1f5f9;
        --text-light: #cbd5e1;
        --text-muted: #94a3b8;
        --border: #334155;
        --bg: #0f172a;
        --bg-card: #1e293b;
        --bg-elevated: #1e293b;
        --header-bg: rgba(15, 23, 42, 0.95);
        --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --glow: rgba(232, 93, 76, 0.2);
        
        --gray-50: #1e293b;
        --gray-100: #334155;
        --gray-200: #475569;
        --white: #1e293b;
    }
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.main-header {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 9999; /* raised so header and hover areas are above page content */
    overflow: visible;
}

/* Ensure header/nav accept pointer events even if some page elements overlap */
.main-header,
.navbar,
.navbar .container,
.nav-menu,
.menu-toggle,
.has-dropdown,
.dropdown-toggle {
    pointer-events: auto !important;
}

.navbar {
    height: var(--header-height);
    overflow: visible;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    overflow: visible;
    flex-wrap: nowrap;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.logo:hover {
    color: var(--primary);
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.theme-icon-light,
.theme-icon-dark {
    font-size: 1.25rem;
    position: absolute;
    transition: all var(--transition);
}

.theme-icon-dark {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.theme-icon-light {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-icon-light {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-icon-dark {
    opacity: 1;
    transform: rotate(0) scale(1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon-light {
        opacity: 0;
        transform: rotate(90deg) scale(0);
    }
    :root:not([data-theme="light"]) .theme-icon-dark {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Theme Toggle Link in Nav */
.theme-toggle-link .theme-icon-light,
.theme-toggle-link .theme-icon-dark {
    position: static;
    display: inline;
}

.theme-toggle-link .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-toggle-link .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-toggle-link .theme-icon-dark {
    display: inline;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle-link .theme-icon-light {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle-link .theme-icon-dark {
        display: inline;
    }
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 5px;
    z-index: 101;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    touch-action: manipulation; /* Verhindert Doppeltipp-Zoom */
    -webkit-tap-highlight-color: rgba(0,0,0,0.1); /* Feedback auf iOS */
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: var(--bg-card);
    padding: calc(var(--header-height) + var(--space-lg)) var(--space-lg) var(--space-lg);
    box-shadow: var(--shadow-xl);
    transition: right var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain; /* Prevent scroll chaining */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    z-index: 100;
}

.nav-menu.active {
    right: 0;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Mobile: User-Menu-Dropdown ausblenden, einzelne Links zeigen */
.user-menu-dropdown {
    display: none;
}

.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

/* Mobile Dropdown-Menüs (innerhalb des nav-menu) */
@media (max-width: 1023px) {
    .nav-menu .has-dropdown {
        position: relative;
    }
    
    .nav-menu .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: var(--space-xs);
        margin-left: var(--space-md);
        padding: var(--space-xs) 0;
        box-shadow: none;
        border-left: 2px solid var(--primary);
        background: transparent;
    }
    
    .nav-menu .dropdown-menu a {
        padding: var(--space-xs) var(--space-md);
        font-size: 0.9rem;
    }
    
    .nav-menu .dropdown-menu.show {
        display: block;
    }
}

/* Nav Icon Links (Quick Actions) */
.nav-icon-link {
    font-size: 1.1rem;
    padding: var(--space-xs) var(--space-sm) !important;
    position: relative;
}

.nav-icon-link .badge-small {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
}

.nav-add-btn {
    background: var(--primary);
    color: white !important;
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.nav-add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* User Avatar klein */
.user-avatar-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-menu-name {
    margin-left: var(--space-xs);
}

/* Dropdown Section Titles */
.dropdown-section-title {
    padding: var(--space-xs) var(--space-lg);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Theme Toggle */
.nav-theme-toggle {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

/* Auth Buttons */
.btn-register {
    background: var(--primary) !important;
    color: white !important;
    border-radius: var(--radius-md);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text);
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    background: var(--bg-card);
    padding: var(--space-sm) 0;
    margin-top: var(--space-xs);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10001; /* ensure sits above header/content */
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Ensure hover also reveals dropdown even without JS toggling */

.dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--text);
}

.dropdown-menu a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Submenu (nested dropdown) */
.has-submenu {
    position: relative;
}

.has-submenu > a::after {
    content: '›';
    margin-left: auto;
    padding-left: 0.5rem;
}

.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--bg-card);
    min-width: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    z-index: 1001;
}

.has-submenu:hover > .submenu {
    display: block;
}

.submenu a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--text);
    white-space: nowrap;
}

.submenu a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Dropdown Divider & Hint */
.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-xs) 0;
}

.dropdown-hint {
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-sm) 0;
}

/* User Area */
.nav-user {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-dropdown-menu {
    display: none;
    background: var(--bg-card);
    margin-top: var(--space-sm);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text);
}

.user-dropdown-menu a:hover {
    background: var(--gray-100);
}

.user-dropdown-menu hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--space-xs) 0;
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding: var(--space-lg) 0;
}

/* ============================================
   HERO / SEARCH SECTION
   ============================================ */
.hero-section {
    text-align: center;
    padding: var(--space-xl) 0;
}

.hero-section.compact {
    padding: var(--space-md) 0 var(--space-sm);
}

.hero-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.hero-title.small {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.hero-subtitle {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* Search Form */
.search-form {
    max-width: 500px;
    margin: 0 auto;
    flex: 1;
}

/* Search + Filter Row */
.search-filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    max-width: 550px;
    margin: 0 auto;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    flex-shrink: 0;
}

.filter-toggle-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.filter-toggle-btn.has-filter {
    border-color: var(--primary);
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Active Filter Info */
.active-filter-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-sm);
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.75rem;
    background: var(--tag-color, var(--primary));
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

.remove-filter:hover {
    background: rgba(255,255,255,0.5);
}

.clear-all-filters {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: underline;
    margin-left: var(--space-xs);
}

.clear-all-filters:hover {
    color: var(--primary);
}

.filter-section-title small {
    font-weight: normal;
    color: var(--text-muted);
    font-size: 0.625rem;
    text-transform: none;
}

/* Filter Dropdown */
.filter-dropdown {
    position: relative;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-dropdown.open {
    max-height: 500px;
}

.filter-dropdown-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-top: var(--space-sm);
    box-shadow: var(--shadow-lg);
}

.filter-section {
    margin-bottom: var(--space-md);
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-xs);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    transition: all var(--transition);
}

.filter-option:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-icon {
    font-size: 1rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.search-input-wrapper {
    display: flex;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: border-color var(--transition);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
}

.search-input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    border: none;
    outline: none;
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text);
}

.search-btn {
    padding: var(--space-md) var(--space-lg);
    background: var(--primary);
    color: var(--white);
    transition: background var(--transition);
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-icon {
    font-size: 1.25rem;
}

/* ============================================
   CATEGORY FILTER
   ============================================ */
.category-filter {
    margin-bottom: var(--space-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-chips {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Tag Filter */
.tag-filter {
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tag-filter::-webkit-scrollbar {
    display: none;
}

.tag-chips {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.tag-chips.inline {
    flex-wrap: wrap;
}

.tag-chip {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--tag-color, var(--gray-500));
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: transform var(--transition), opacity var(--transition);
}

.tag-chip.small {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
}

.tag-chip:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.tag-chip.active {
    box-shadow: 0 0 0 3px var(--tag-color, var(--gray-500)), 0 0 0 5px var(--bg);
}

/* Results Info */
.results-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   RECIPE GRID
   ============================================ */
.recipes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

/* Recipe Card */
.recipe-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), 0 0 40px var(--glow);
}

.recipe-card-link {
    display: block;
    color: inherit;
}

.recipe-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.05);
}

.recipe-category {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.favorite-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-full);
    font-size: 1.125rem;
    transition: transform var(--transition);
    z-index: 2;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.is-favorite {
    background: var(--primary);
}

.recipe-content {
    padding: var(--space-md);
}

.recipe-title {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Recipe Card Rating */
.recipe-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.recipe-rating .sterne-display {
    display: flex;
    align-items: center;
}

.recipe-rating .stern {
    font-size: 0.875rem;
}

.recipe-rating .stern.voll,
.recipe-rating .stern.halb {
    color: #fbbf24;
}

.recipe-rating .stern.leer {
    color: var(--gray-300);
}

.recipe-rating .rating-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-2xl);
}

.pagination-link {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 500;
}

.pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   NO RESULTS
   ============================================ */
.no-results {
    text-align: center;
    padding: var(--space-2xl);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.no-results h2 {
    margin-bottom: var(--space-sm);
}

.no-results p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ============================================
   RECIPE DETAIL PAGE
   ============================================ */
.recipe-hero {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.recipe-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3));
}

.recipe-breadcrumb {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.recipe-breadcrumb a {
    color: #1e293b;
}

.recipe-breadcrumb .separator {
    color: #64748b;
}

.recipe-detail-content {
    margin-top: -30px;
    position: relative;
    z-index: 1;
}

.recipe-header {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow);
}

.recipe-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.recipe-header .recipe-title {
    font-size: 1.5rem;
    flex: 1;
}

.favorite-btn-large {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.favorite-btn-large:hover {
    background: var(--gray-200);
}

.favorite-btn-large.is-favorite {
    background: #fee2e2;
    color: var(--primary);
}

.recipe-header .recipe-description {
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    font-size: 1rem;
}

/* Recipe Info Bar */
.recipe-info-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.info-icon {
    font-size: 1.5rem;
}

.info-content {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--text);
}

/* Recipe Extra Info (Author & Rating) */
.recipe-extra-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.recipe-author {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.author-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.author-name {
    font-weight: 500;
    color: var(--text);
}

.recipe-rating-section {
    display: flex;
    align-items: center;
}

.rating-compact {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.rating-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.no-ratings-hint {
    font-style: italic;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.current-rating .stern {
    font-size: 1.25rem;
}

.current-rating .stern.voll,
.current-rating .stern.halb {
    color: #fbbf24;
}

.current-rating .stern.leer {
    color: var(--gray-300);
}

.current-rating .bewertung-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-left: var(--space-sm);
}

.no-ratings {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-300);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.active,
.star-btn.hover {
    color: #fbbf24;
}

.star-btn.half {
    background: linear-gradient(90deg, #fbbf24 50%, var(--gray-300) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star-rating:hover .star-btn {
    color: var(--gray-300);
}

.star-rating:hover .star-btn.hover {
    color: #fbbf24;
}

.login-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-hint a {
    color: var(--primary);
    font-weight: 500;
}

/* Recipe Body */
.recipe-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

/* Ingredients */
.ingredients-card {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.ingredients-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.ingredients-header h2 {
    font-size: 1.25rem;
}

.portions-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gray-100);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
}

.portion-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1.125rem;
    transition: background var(--transition);
}

.portion-btn:hover {
    background: var(--gray-200);
}

.ingredients-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.ingredient-amount {
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
}

.ingredient-unit {
    color: var(--text-muted);
    min-width: 40px;
}

/* Instructions */
.instructions-section {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.instructions-section h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.instructions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    counter-reset: step;
}

.instruction-step {
    display: flex;
    gap: var(--space-md);
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.step-content {
    flex: 1;
    padding-top: var(--space-xs);
}

.step-content p {
    line-height: 1.7;
}

/* Tips Section */
.tips-section {
    background: var(--gray-100);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--warning);
}

.tips-section h2 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
}

/* Nutrition */
.nutrition-section {
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.nutrition-section h2 {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.nutrition-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: flex-start;
}

.nutrition-item {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    min-width: 80px;
    flex: 0 1 auto;
}

.nutrition-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.nutrition-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recipe Actions */
.recipe-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 200px);
    padding: var(--space-lg);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.alert ul {
    margin: 0;
    padding-left: var(--space-lg);
    list-style: disc;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Flash Messages */
.flash-message {
    padding: var(--space-md) 0;
    font-size: 0.875rem;
}

.flash-message .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-close {
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-page {
    padding: var(--space-lg) 0;
}

.page-header {
    margin-bottom: var(--space-xl);
    text-align: center;
}

.page-header h1 {
    font-size: 1.75rem;
    text-align: center;
}

.page-header .subtitle, .page-header p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 auto var(--space-lg) auto;
    text-align: center;
    max-width: 600px;
}

.profile-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.125rem;
}

.card-body {
    padding: var(--space-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   FAVORITES PAGE
   ============================================ */
.favorites-page {
    padding: var(--space-lg) 0;
}

.favorites-page .page-header p {
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    background: var(--secondary);
    color: var(--gray-300);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: auto;
}

.footer-content {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.footer-text {
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-links a {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-700);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ============================================
   NOT FOUND
   ============================================ */
.not-found {
    text-align: center;
    padding: var(--space-2xl);
}

.not-found h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.not-found p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .main-header,
    .main-footer,
    .favorite-btn,
    .favorite-btn-large,
    .recipe-actions,
    .recipe-breadcrumb {
        display: none !important;
    }
    
    .recipe-hero {
        height: 200px;
    }
    
    .recipe-body {
        display: block;
    }
    
    .ingredients-card,
    .instructions-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* ============================================
   TABLET BREAKPOINT (640px+)
   ============================================ */
@media (min-width: 640px) {
    .recipes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recipe-info-bar {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .recipe-hero {
        height: 350px;
    }
}

/* ============================================
   DESKTOP BREAKPOINT (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    :root {
        --header-height: 70px;
    }
    
    /* Navigation */
    .menu-toggle {
        display: none;
    }
    
    .nav-menu {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        padding: 0;
        background: transparent;
        box-shadow: none;
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        overflow: visible;
    }
    
    /* Desktop Navigation Layout */
    .nav-main {
        flex-direction: row;
        gap: 2px;
    }
    
    .nav-user-section {
        flex-direction: row;
        margin-left: auto;
    }
    
    .nav-auth {
        flex-direction: row;
        margin-left: auto;
        gap: var(--space-sm);
    }
    
    .nav-theme-toggle {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        margin-left: var(--space-sm);
    }
    
    /* Desktop: User-Menu anzeigen, mobile Links ausblenden */
    .user-menu-dropdown {
        display: block;
    }
    
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
    
    /* Desktop Quick Actions */
    .nav-user-section .desktop-only {
        display: flex !important;
        align-items: center;
    }
    
    .nav-links {
        flex-direction: row;
        gap: 2px;
        overflow: visible;
    }
    
    .nav-link {
        padding: var(--space-xs) var(--space-sm);
        white-space: nowrap;
        font-size: 0.9rem;
    }
    
    .has-dropdown {
        position: relative;
        overflow: visible;
    }
    
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        margin-top: 0;
        padding: var(--space-sm) 0;
        background: var(--bg-card);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xl);
        opacity: 0;
        visibility: hidden;
        z-index: 10001;
        transform: translateY(10px);
        transition: all var(--transition);
    }
    
    .has-dropdown:hover .dropdown-menu,
    .dropdown-menu.show {
        display: block;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    /* Extra safety: ensure dropdown toggles are clickable and visible */
    .dropdown-toggle {
        cursor: pointer;
    }
    
    /* Submenu Desktop - erscheint rechts */
    .has-submenu {
        position: relative;
    }
    
    .has-submenu > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .submenu {
        left: 100%;
        top: 0;
        margin-left: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-10px);
        transition: all var(--transition);
    }
    
    .has-submenu:hover > .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    /* User Mega Menu - rechtsbündig */
    .user-menu-dropdown .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 250px;
    }
    
    .user-menu-toggle {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
        padding: var(--space-xs) var(--space-sm) !important;
        background: var(--gray-100);
        border-radius: var(--radius-full);
    }
    
    .user-menu-toggle:hover {
        background: var(--gray-200);
    }
    
    .nav-user {
        flex-direction: row;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    
    .user-dropdown-menu {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: var(--space-sm);
        min-width: 180px;
    }
    
    /* Hero */
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Grid */
    .recipes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Recipe Detail */
    .recipe-hero {
        height: 450px;
    }
    
    .recipe-header .recipe-title {
        font-size: 2rem;
    }
    
    .recipe-body {
        flex-direction: row;
    }
    
    .recipe-sidebar {
        width: 350px;
        flex-shrink: 0;
    }
    
    .recipe-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .ingredients-card {
        position: sticky;
        top: calc(var(--header-height) + var(--space-lg));
    }
    
    /* Profile */
    .profile-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: var(--space-lg);
    }
    
    .profile-grid .card:first-child {
        grid-row: span 2;
    }
}

/* ============================================
   LARGE DESKTOP (1280px+)
   ============================================ */
@media (min-width: 1280px) {
    .recipes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Größere Navigation auf großen Bildschirmen */
    .nav-main {
        gap: var(--space-xs);
    }
    
    .nav-link {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.95rem;
    }
}

/* ============================================
   MULTIPLE IMAGE UPLOAD
   ============================================ */
.existing-images {
    margin-bottom: var(--space-lg);
}

.existing-images .form-hint {
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.bilder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-md);
}

.bild-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg);
    border: 2px solid var(--border);
    transition: var(--transition);
}

.bild-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bild-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bild-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs);
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.bild-nummer {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-delete-img {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: rgba(255,255,255,0.9);
    color: var(--danger);
}

.btn-delete-img:hover {
    background: var(--danger);
    color: white;
}

.neue-bilder-upload {
    margin-top: var(--space-md);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text-muted);
    gap: var(--space-sm);
}

.upload-label:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

.upload-icon {
    font-size: 2rem;
}

#bilder {
    display: none;
}

.bilder-vorschau {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.bilder-vorschau .vorschau-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    border: 2px solid var(--border);
}

.bilder-vorschau .vorschau-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bilder-vorschau .vorschau-item .remove-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Recipe Gallery */
.recipe-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.recipe-slideshow .slideshow-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.recipe-slideshow .slideshow-image.active {
    opacity: 1;
}

.slideshow-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slideshow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: var(--transition);
}

.slideshow-dot.active {
    background: white;
    transform: scale(1.2);
}

.slideshow-dot:hover {
    background: rgba(255,255,255,0.8);
}

/* Slideshow Items (für Community-Fotos Integration) */
.slideshow-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.slideshow-item.active {
    opacity: 1;
}

.slideshow-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Community Badge im Slideshow */
.community-badge {
    position: absolute;
    bottom: 50px;
    left: 16px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    z-index: 5;
    backdrop-filter: blur(4px);
}

/* Community Dot in Slideshow */
.slideshow-dot.community-dot {
    background: rgba(255, 200, 100, 0.6);
}

.slideshow-dot.community-dot.active {
    background: #ffd700;
}

/* Mini Upload Button im Hero */
.mini-upload-btn {
    position: absolute;
    bottom: 20px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.mini-upload-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Tags unter Bewertung */
.tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.tags-edit-mini {
    opacity: 0.6;
    font-size: 0.9rem;
}

.tags-edit-mini:hover {
    opacity: 1;
}

.recipe-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recipe-tags-inline .tag-chip {
    font-size: 0.75rem;
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.recipe-tags-inline .tag-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Hauptbild Marker in Preview */
.vorschau-item .hauptbild-marker {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ============================================
   KOMMENTARE
   ============================================ */
.kommentare-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.kommentare-section h2 {
    margin-bottom: var(--space-lg);
    font-size: 1.5rem;
}

/* Kommentar Formular */
.kommentar-form-container {
    margin-bottom: var(--space-xl);
}

.kommentar-form .form-group {
    position: relative;
    margin-bottom: var(--space-md);
}

.kommentar-form textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.kommentar-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.kommentar-form .char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kommentar-login-hint {
    padding: var(--space-md);
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.kommentar-login-hint a {
    color: var(--primary);
    font-weight: 600;
}

/* Kommentar Liste */
.kommentare-liste {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.keine-kommentare {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-lg);
    font-style: italic;
}

.kommentar-item {
    position: relative;
    padding: var(--space-md);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.kommentar-item:hover {
    border-color: var(--primary-light);
}

.kommentar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.kommentar-autor {
    font-weight: 600;
    color: var(--text);
}

.kommentar-datum {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.kommentar-text {
    color: var(--text);
    line-height: 1.6;
    word-wrap: break-word;
}

.kommentar-loeschen {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    font-size: 1rem;
    padding: 4px;
}

.kommentar-loeschen:hover {
    opacity: 1;
}

/* ============================================
   TAGS MODAL
   ============================================ */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.tag-checkbox:hover {
    border-color: var(--tag-color, var(--primary));
    background: color-mix(in srgb, var(--tag-color, var(--primary)) 10%, transparent);
}

.tag-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--tag-color, var(--primary));
}

.tag-checkbox:has(input:checked) {
    background: var(--tag-color, var(--primary));
    border-color: var(--tag-color, var(--primary));
    color: white;
}

.tag-checkbox:has(input:checked) input {
    accent-color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .kommentar-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   SAMMLUNGEN TABS & VERWALTUNG
   ============================================ */

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-link {
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
}

.tab-link:hover {
    color: var(--primary);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Sammlungen Grid (Übersicht) */
.sammlungen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.sammlung-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    text-align: center;
}

.sammlung-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.sammlung-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.sammlung-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.sammlung-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Sammlungen Verwaltungsliste */
.sammlungen-manage-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sammlung-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    gap: var(--space-lg);
}

.sammlung-manage-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex: 1;
}

.sammlung-icon-large {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.sammlung-manage-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.sammlung-manage-info .sammlung-beschreibung {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.sammlung-manage-info .sammlung-count {
    font-size: 0.8rem;
}

.sammlung-manage-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.sammlungen-actions {
    margin-bottom: var(--space-xl);
}

/* Button Styles für Sammlungen */
.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--danger) 85%, black);
}

/* Responsive */
@media (max-width: 640px) {
    .tabs-nav {
        gap: 0;
    }
    
    .tab-link {
        flex: 1;
        text-align: center;
        padding: var(--space-sm);
        font-size: 0.9rem;
    }
    
    .sammlungen-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .sammlung-card {
        padding: var(--space-lg);
    }
    
    .sammlung-icon {
        font-size: 2rem;
    }
    
    .sammlung-manage-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sammlung-manage-left {
        width: 100%;
    }
    
    .sammlung-manage-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: var(--space-sm);
    }
}