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

:root {
    --bg-color: #0c0d12;
    --card-bg: rgba(22, 24, 35, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary-color: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b; /* Amber */
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444; /* Rose */
    --danger-glow: rgba(239, 68, 68, 0.15);
    --accent: #ec4899; /* Pink */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --header-bg: rgba(12, 13, 18, 0.8);
    --footer-gradient: linear-gradient(0deg, rgba(12, 13, 18, 0.95) 60%, rgba(12, 13, 18, 0) 100%);
    --bubble-bg: rgba(22, 24, 35, 0.9);
    --input-bg: rgba(255, 255, 255, 0.05);
}

body.light-theme {
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --primary-color: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.12);
    --warning: #d97706;
    --warning-glow: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.12);
    --accent: #db2777;
    --header-bg: rgba(243, 244, 246, 0.85);
    --footer-gradient: linear-gradient(0deg, rgba(243, 244, 246, 0.95) 60%, rgba(243, 244, 246, 0) 100%);
    --bubble-bg: rgba(255, 255, 255, 0.95);
    --input-bg: rgba(0, 0, 0, 0.03);
}

body.light-theme {
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.03) 0px, transparent 50%);
}

body.light-theme .drawer-handle {
    background: rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: 110px; /* Space for the microphone button */
}

/* Header */
header {
    background: var(--header-bg, rgba(12, 13, 18, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-weight: 300;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

.gemini-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 10px;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border-radius: 99px;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

#theme-toggle,
#info-link,
#settings-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
}

#theme-toggle:hover,
#info-link:hover,
#settings-trigger:hover {
    background-color: var(--input-bg, rgba(255, 255, 255, 0.05));
    color: var(--text-primary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-dot.active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Main Container */
main {
    flex: 1;
    padding: 20px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Recipe Generator Trigger Card */
.recipe-hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-hero:active {
    transform: scale(0.98);
}

.recipe-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-hero-tag {
    align-self: flex-start;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    display: inline-block;
}

.recipe-hero h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.recipe-hero p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.recipe-hero button {
    margin-top: 6px;
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.recipe-hero button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    filter: brightness(1.1);
}

#recipe-custom-wishes:focus {
    border-color: rgba(99, 102, 241, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.08) !important;
}

body.light-theme #recipe-custom-wishes:focus {
    border-color: rgba(79, 70, 229, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background: #ffffff !important;
}

#recipe-custom-wishes::placeholder {
    color: var(--text-secondary);
    opacity: 0.65;
}

/* Pantry Section Header */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-title h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.item-count {
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid var(--card-border);
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
}

#share-pantry-btn:hover {
    color: var(--primary-color) !important;
    background-color: var(--input-bg) !important;
}

/* Inventory List */
.pantry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-icon {
    font-size: 2.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Food Card */
.food-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.food-card:active {
    transform: scale(0.99);
}

.food-card.expiry-red {
    border-left: 4px solid var(--danger);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, var(--card-bg) 100%);
}

.food-card.expiry-yellow {
    border-left: 4px solid var(--warning);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, var(--card-bg) 100%);
}

.food-card.expiry-green {
    border-left: 4px solid var(--success);
}

.food-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.food-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.food-info:hover .food-name {
    color: var(--primary-color);
}

.food-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
    transition: color 0.2s ease;
}

.food-expiry {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.expiry-red .food-expiry { color: var(--danger); }
.expiry-yellow .food-expiry { color: var(--warning); }
.expiry-green .food-expiry { color: var(--success); }

.food-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 8px;
}

.food-quantity-display {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--card-border);
    padding: 3px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 28px;
    box-sizing: border-box;
}

.food-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 2px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s ease;
}

.quantity-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 4px;
    cursor: pointer;
    margin-left: 6px;
}

.delete-btn:active {
    color: var(--danger);
}

/* Expiry Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.expiry-red .progress-bar { background-color: var(--danger); }
.expiry-yellow .progress-bar { background-color: var(--warning); }
.expiry-green .progress-bar { background-color: var(--success); }

/* Sticky Footer (Voice Input Panel) */
.footer-voice-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--footer-gradient);
    padding: 20px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    z-index: 200;
    pointer-events: none; /* Allows click through the transparent top gradient */
}

.transcription-bubble {
    background: var(--bubble-bg, rgba(22, 24, 35, 0.9));
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    max-width: 90%;
    text-align: center;
    color: var(--text-primary);
    display: none;
    pointer-events: auto;
    animation: fadeInUp 0.2s ease-out;
}

.transcription-bubble.listening {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.transcription-bubble.processing {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.mic-container {
    pointer-events: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px var(--primary-glow);
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mic-btn:active {
    transform: scale(0.92);
}

.scan-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px var(--primary-glow);
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.scan-btn:active {
    transform: scale(0.92);
}

/* Glowing Pulse Rings */
.mic-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.mic-btn.active ~ .mic-ring-1 {
    animation: pulseGlow 1.8s infinite ease-out;
}

.mic-btn.active ~ .mic-ring-2 {
    animation: pulseGlow 1.8s infinite ease-out 0.6s;
}

.mic-btn.active ~ .mic-ring-3 {
    animation: pulseGlow 1.8s infinite ease-out 1.2s;
}

/* Modal Drawer for Recipes */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80vh;
    background: var(--bg-color);
    border-top: 1px solid var(--card-border);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 310;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.drawer.open {
    transform: translateY(0);
}

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

.drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 8px auto 0 auto;
}

.drawer-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-drawer-btn {
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Recipes container */
.recipes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.recipe-header-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.recipe-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.recipe-category-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 99px;
}

.recipe-unsaved-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--input-bg);
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--card-border);
}

.recipe-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin-top: 4px;
}

.recipe-card-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 2px;
}

.recipe-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.recipe-card-meta .meta-item svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.recipe-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recipe-meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.recipe-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Ingredients layout */
.ingredients-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ingredients-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.ingredients-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ingredient-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 500;
}

.ingredient-tag.owned {
    background: var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.ingredient-tag.additional {
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

.ingredient-tag.missing {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.recipe-missing-alert-badge {
    background: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    cursor: help;
}

/* Instructions list */
.instructions-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instructions-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction-step {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    gap: 10px;
}

.step-num {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 18px;
}

.use-recipe-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 12px 20px;
    border-radius: 99px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    user-select: none;
    outline: none;
}

.use-recipe-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.use-recipe-btn:active {
    transform: scale(0.97);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: rgba(22, 24, 35, 0.95);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    animation: slideDown 0.3s ease-out;
    touch-action: none;
    user-select: none;
    cursor: grab;
}

.toast:active {
    cursor: grabbing;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--primary-color); }

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    z-index: 350;
    display: none;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}

.settings-modal.open {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Categories Multi-Select */
.categories-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.category-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.category-checkbox-label.selected {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.form-group input, .form-group select, .form-group textarea {
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239ca3af' d='M0 0l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

body.light-theme .form-group select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%234b5563' d='M0 0l5 5 5-5z'/></svg>");
}

.form-group select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.save-settings-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 99px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    user-select: none;
}

.save-settings-btn:hover {
    box-shadow: 0 6px 16px var(--primary-glow);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.save-settings-btn:active {
    transform: scale(0.97);
}

/* Animations */
@keyframes pulseGlow {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

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

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

.gemini-status.active {
    color: var(--success) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
    background: var(--success-glow) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.gemini-status.active .status-icon {
    animation: statusPulse 2s infinite alternate;
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* Tabs Navigation (Vom Hirn ins Terminal Style) */
.tabs-nav {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    margin-bottom: 24px;
}

.tabs-nav-row-1 {
    display: flex;
    gap: 16px;
    flex: 2;
}

.tab-btn {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--card-bg, rgba(22, 24, 35, 0.6));
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tab-btn.full-width-tab {
    flex: 1;
}

body.light-theme .tab-btn {
    background: rgba(255, 255, 255, 0.75);
    border: 1.2px solid rgba(0, 0, 0, 0.12);
    color: #374151; /* slate-700 for better visibility */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2px;
    transition: transform 0.2s ease;
}

.tab-btn:hover svg {
    transform: translateY(-2px);
}

.tab-btn span {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Floating Badge */
.tab-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 7px;
    min-width: 18px;
    height: 18px;
    line-height: 1;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    border: 1.5px solid var(--bg-color);
}

/* Badge colors */
.tab-badge.pantry-badge {
    background: #4f46e5; /* Indigo */
}
.tab-badge.recipe-badge {
    background: #ef4444; /* Red */
}
.tab-badge.shopping-badge {
    background: #10b981; /* Green */
}

/* Elegant bottom indicator line */
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 35%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s;
    background-color: transparent;
}

.tab-btn.active::after {
    transform: translateX(-50%) scaleX(1);
}

.tab-btn[data-tab="pantry-tab"].active::after {
    background-color: #6366f1;
    box-shadow: 0 -1px 8px rgba(99, 102, 241, 0.8);
}
.tab-btn[data-tab="recipebook-tab"].active::after {
    background-color: #ef4444;
    box-shadow: 0 -1px 8px rgba(239, 68, 68, 0.8);
}
.tab-btn[data-tab="shoppinglist-tab"].active::after {
    background-color: #10b981;
    box-shadow: 0 -1px 8px rgba(16, 185, 129, 0.8);
}

/* Active State Colors tailored by Tab */
/* 1. Speisekammer */
.tab-btn[data-tab="pantry-tab"].active {
    color: #818cf8; /* Light Indigo */
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.03));
    border: 1.5px solid rgba(99, 102, 241, 0.45);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.light-theme .tab-btn[data-tab="pantry-tab"].active {
    color: #4f46e5; /* Dark Indigo */
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.02));
    border: 1.5px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 2. Rezepte */
.tab-btn[data-tab="recipebook-tab"].active {
    color: #f87171; /* Light Red */
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.03));
    border: 1.5px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.light-theme .tab-btn[data-tab="recipebook-tab"].active {
    color: #dc2626; /* Dark Red */
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.02));
    border: 1.5px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 3. Einkaufsliste */
.tab-btn[data-tab="shoppinglist-tab"].active {
    color: #34d399; /* Light Green */
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0.03));
    border: 1.5px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body.light-theme .tab-btn[data-tab="shoppinglist-tab"].active {
    color: #059669; /* Dark Green */
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.02));
    border: 1.5px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Hover and Active Micro-Animations */
@media (hover: hover) {
    .tab-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.22);
    }
    body.light-theme .tab-btn:hover {
        background: rgba(0, 0, 0, 0.04);
        border-color: rgba(0, 0, 0, 0.18);
        color: var(--text-primary);
    }
}
.tab-btn:active {
    transform: scale(0.96);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.tab-content.active {
    display: flex;
}

/* Search and Filters */
.search-filter-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    transition: background-color 0.15s, color 0.15s;
    outline: none;
}

.search-clear-btn:hover {
    background-color: var(--card-border);
    color: var(--text-primary);
}

.search-wrapper input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 38px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-wrapper input:focus {
    border-color: var(--primary-color);
}

.category-filters {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none; /* Firefox */
}

.category-filters::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.filter-chip {
    white-space: nowrap;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 99px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-chip.filter-chip-warning {
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--danger);
    font-weight: 700;
}

.filter-chip.filter-chip-warning.active {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #ffffff !important;
}

/* Saved Recipes List */
.saved-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-db-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.recipe-db-card:active {
    transform: scale(0.99);
}

.recipe-db-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.recipe-db-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recipe-db-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 6px;
}

.recipe-db-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.recipe-db-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    border-top: 1px solid var(--card-border);
    padding-top: 8px;
}

.recipe-db-portions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Save Recipe Button inside Drawer */
.save-recipe-drawer-btn {
    margin-top: 8px;
    width: 100%;
    background: #1c1e2d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 12px;
    border-radius: 99px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

body.light-theme .save-recipe-drawer-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.save-recipe-drawer-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

body.light-theme .save-recipe-drawer-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.save-recipe-drawer-btn:active {
    transform: scale(0.97);
}

.save-recipe-drawer-btn.saved {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--card-border) !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
}

body.light-theme .save-recipe-drawer-btn.saved {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: var(--card-border) !important;
    color: var(--text-secondary) !important;
}

/* Star Rating styling */
.star-rating-ctrl {
    display: flex;
    gap: 4px;
    align-items: center;
}

.star-rating-ctrl .star {
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.star-rating-ctrl .star.active {
    color: var(--primary-color) !important;
}

@media (hover: hover) {
    .star-rating-ctrl .star:hover {
        transform: scale(1.25);
    }
}

/* Scanner Viewfinder Laser Animation */
@keyframes laserScan {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

/* Dynamic Editor List Rows */
.editor-list-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.editor-delete-row-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.1s;
}

.editor-delete-row-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.editor-delete-row-btn:active {
    transform: scale(0.9);
}

.editor-move-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: color 0.15s, transform 0.1s;
    user-select: none;
}

.editor-move-btn:hover {
    color: var(--primary-color);
    transform: scale(1.15);
}

.editor-move-btn:active {
    transform: scale(0.9);
}

.editor-drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--text-secondary);
    user-select: none;
    touch-action: none;
    transition: color 0.15s, transform 0.1s;
}

.editor-drag-handle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.editor-drag-handle:active {
    cursor: grabbing;
}

.editor-list-row.dragging {
    position: relative;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    background-color: var(--card-bg);
    border-radius: 8px;
    opacity: 0.95;
    transform: scale(1.015);
    transition: none !important;
}

.editor-list-row.dragging input,
.editor-list-row.dragging button {
    pointer-events: none;
}

/* Edit Recipe Button inside cards */
.edit-recipe-card-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.edit-recipe-card-btn:hover {
    color: var(--primary-color);
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    width: 160px;
    user-select: none;
}

.custom-dropdown.open {
    z-index: 10;
}

.custom-dropdown-trigger {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.custom-dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bubble-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
    animation: slideDownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-dropdown.open .custom-dropdown-options {
    display: flex;
}

.custom-dropdown-option {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.custom-dropdown-option:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.custom-dropdown-option.selected {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Portion Changer Button Hover & Active States */
.portion-change-btn {
    transition: all 0.2s ease-in-out !important;
}

.portion-change-btn:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 8px var(--primary-glow) !important;
}

.portion-change-btn:active {
    transform: scale(0.88) !important;
}

#custom-dropdown-pantry-sort-select {
    width: 220px;
}

.share-recipe-btn:hover {
    color: var(--primary-color) !important;
    background-color: var(--input-bg) !important;
}

/* User profiles login page */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.light-theme .login-overlay {
    background-color: #ffffff;
    background-image: none;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    padding: 32px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-header {
    text-align: center;
}

.login-header .logo {
    display: flex;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header .logo span {
    font-weight: 300;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.login-form select,
.login-form input {
    width: 100%;
    height: 48px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0 16px;
    font-family: var(--font-sans);
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form select:focus,
.login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-btn {
    width: 100%;
    height: 48px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    opacity: 0.9;
}

.login-btn:active {
    transform: scale(0.98);
}

/* User Badge in Header */
.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 99px;
    background: var(--primary-color);
    color: #ffffff;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    font-family: var(--font-sans);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.user-badge:hover {
    opacity: 0.95;
    background-color: #4f46e5;
}

.user-badge:active {
    transform: scale(0.95);
}

.user-badge svg {
    stroke: #ffffff;
}

.user-badge span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Mobile view adjustments (Smartphones) */
@media (max-width: 600px) {
    header {
        padding: 10px 14px;
        gap: 8px;
    }

    .logo-wrapper img {
        height: 32px;
        width: 32px;
    }
    
    .logo {
        font-size: 1.15rem;
    }
    
    .user-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
        box-shadow: none;
    }

    .user-badge span {
        max-width: 70px;
    }

    .header-right {
        gap: 6px;
    }

    #gemini-status-text {
        display: none !important;
    }
    
    .gemini-status {
        padding: 0;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .gemini-status svg {
        width: 14px;
        height: 14px;
    }
    
    #theme-toggle,
    #info-link,
    #settings-trigger {
        padding: 6px;
    }

    .food-name {
        font-size: 0.88rem;
    }

    .food-actions {
        gap: 6px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .user-badge span {
        display: none !important;
    }
    
    .user-badge {
        width: 32px;
        height: 32px;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center;
        flex-shrink: 0;
    }

    .logo span {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .logo {
        display: none !important;
    }
    
    header {
        gap: 4px;
        padding: 10px 8px;
    }
    
    .header-right {
        gap: 4px;
    }
}

/* Einkaufsliste Styles */
.shopping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin-bottom: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.shopping-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.shopping-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.shopping-item-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: transparent;
}

.shopping-item.checked .shopping-item-checkbox {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.shopping-item-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}

.shopping-item.checked .shopping-item-text {
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

.shopping-item-delete {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.shopping-item-delete:hover {
    color: var(--danger, #ef4444);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Große Tab-Buttons */
.tabs-nav {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.tabs-nav-row-1 {
    width: 100%;
    gap: 14px;
    order: 2;
}

.tab-btn {
    padding: 16px 14px;
    border-radius: 16px;
}

.tab-btn.full-width-tab {
    width: 100%;
    order: 1;
}

.tab-badge {
    top: 8px;
    right: 10px;
}

/* Rezeptbuch-Drawer Anpassung */
#recipebook-drawer {
    background: var(--bg-color);
}

#shopping-mic-btn:hover,
#shopping-scan-btn:hover {
    border-color: var(--primary-color) !important;
    background: var(--input-bg) !important;
    color: var(--primary-color) !important;
    transform: scale(1.05);
}

#shopping-save-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#shopping-save-btn:active,
#shopping-mic-btn:active,
#shopping-scan-btn:active {
    transform: scale(0.98);
}

/* Trenner und Drag-and-Drop für Einkaufsliste */
.shopping-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px 0;
    user-select: none;
    pointer-events: none;
}

.shopping-divider::before,
.shopping-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed var(--card-border);
}

.shopping-divider:not(:empty)::before {
    margin-right: 12px;
}

.shopping-divider:not(:empty)::after {
    margin-left: 12px;
}

.shopping-item-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: grab;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.15s, transform 0.1s;
    user-select: none;
    touch-action: none;
}

.shopping-item-drag-handle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.shopping-item-drag-handle:active {
    cursor: grabbing;
}

.shopping-item.dragging {
    position: relative;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    background-color: var(--card-bg);
    opacity: 0.95;
    border-color: var(--primary-color);
    transform: scale(1.02);
    transition: none !important;
}

.shopping-item.dragging button,
.shopping-item.dragging .shopping-item-left {
    pointer-events: none;
}

.shopping-list-ul.reordering-active .shopping-item {
    transition: none !important;
}

/* Mini Navigation styling */
.mini-nav {
    display: none;
    align-items: center;
    gap: 14px;
    background: var(--card-bg, rgba(22, 24, 35, 0.6));
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
    padding: 5px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .mini-nav {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

body.scrolled .mini-nav {
    display: flex;
    animation: slideInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mini-nav-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mini-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .mini-nav-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.mini-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2px;
    transition: transform 0.2s ease;
}

.mini-nav-btn:hover svg {
    transform: scale(1.1);
}

/* Tab-specific active states to match the beautiful main tab colors */
.mini-nav-btn[data-tab="pantry-tab"].active {
    color: #6366f1; /* Indigo */
    background: rgba(99, 102, 241, 0.12);
}

.mini-nav-btn[data-tab="recipebook-tab"].active {
    color: #ef4444; /* Red */
    background: rgba(239, 68, 68, 0.12);
}

.mini-nav-btn[data-tab="shoppinglist-tab"].active {
    color: #10b981; /* Green */
    background: rgba(16, 185, 129, 0.12);
}

/* Mini Tab Badges */
.mini-tab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    color: #ffffff !important;
    font-size: 0.62rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mini-tab-badge#mini-pantry-badge {
    background: #4f46e5;
}

.mini-tab-badge#mini-recipe-badge {
    background: #ef4444;
}

.mini-tab-badge#mini-shopping-badge {
    background: #10b981;
}

/* Responsiveness: on mobile, make room for mini-nav */
@media (max-width: 600px) {
    body.scrolled .logo {
        display: none !important;
    }
    
    body.scrolled .logo-wrapper img {
        height: 28px;
        width: 28px;
    }
    
    body.scrolled .user-badge {
        display: none !important;
    }
    
    body.scrolled .gemini-status {
        display: none !important;
    }
    
    body.scrolled header {
        padding: 8px 10px;
    }
    
    .mini-nav {
        gap: 12px;
        padding: 4px;
        border-radius: 12px;
    }
    
    .mini-nav-btn {
        padding: 10px 18px;
        border-radius: 10px;
    }
    
    .mini-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Custom styles for Offline/Online choices and Admin User Management */
.choice-card {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.choice-card:hover {
    border-color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}
.choice-card:active {
    transform: translateY(0);
}

.admin-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.admin-user-row:hover {
    border-color: var(--primary-color);
}
.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex-grow: 1;
    margin-right: 8px;
}
.admin-user-email {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.admin-user-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.admin-user-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.admin-role-badge {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.admin-role-badge.admin {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
}
.admin-role-badge.user {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.admin-action-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
    color: var(--text-secondary);
}
.admin-action-btn.reset:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}
.admin-action-btn.delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Switch Toggle Styles for Local AI */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card-border);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}


