@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;
}

.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);
}

.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;
    overflow: hidden;
    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: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.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: var(--primary-color);
    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 var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

/* 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;
}

/* 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;
}

.food-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.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;
}

.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);
}

/* 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-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.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);
}

/* 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;
}

.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;
    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;
}

.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 {
    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 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 {
    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;
}

/* Tabs Navigation (NotebookLM Style) */
.tabs-nav {
    display: flex;
    gap: 4px;
    background: var(--input-bg);
    padding: 6px;
    border-radius: 99px;
    border: 1px solid var(--card-border);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

@media (hover: hover) {
    .tab-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.03);
    }
    body.light-theme .tab-btn:hover {
        background: rgba(0, 0, 0, 0.02);
    }
}

.tab-btn:active {
    transform: scale(0.96);
}

.tab-btn.active {
    color: var(--primary-color);
    background: #1c1e2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

body.light-theme .tab-btn.active {
    color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.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-wrapper input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px 16px 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: 8px;
    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: 6px 14px;
    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);
}

/* 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);
    }
}
