:root {
    --primary: #D35400; /* Deep saffron/orange */
    --secondary: #c0392b; /* Rich red */
    --accent: #f39c12; /* Golden turmeric */
    --bg-color: #faf8f5; /* Creamy off-white */
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bot-view {
    display: none;
}
@media print {
    .bot-view { display: none !important; }
}

[data-theme="dark"] {
    --primary: #f39c12; 
    --secondary: #e67e22;
    --bg-color: #121212; 
    --card-bg: #1e1e1e;
    --text-dark: #f5f6fa;
    --text-light: #b2bec3;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

[data-theme="dark"] body {
    color: var(--text-dark);
}

[data-theme="dark"] .app-header {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .ing-card {
    border-color: #333;
}

[data-theme="dark"] .ing-card:hover {
    border-color: var(--primary);
    background: #2a2a2a;
}

[data-theme="dark"] .search-bar {
    background: #2a2a2a;
    border-color: #444;
    color: var(--text-dark);
}

[data-theme="dark"] .category-heading {
    border-bottom: 2px solid #333;
}

[data-theme="dark"] .wizard-view {
    background: var(--card-bg);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    color: var(--text-dark);
}

[data-theme="dark"] .close-btn {
    background: #333;
    color: #f5f6fa;
}

[data-theme="dark"] .close-btn:hover {
    background: #ff7675;
    color: white;
}

[data-theme="dark"] .secondary-btn {
    background: #2a2a2a;
    color: var(--text-dark);
    border-color: #444;
}

[data-theme="dark"] .secondary-btn:hover {
    background: #333;
}

/* Language Dropdown */
.lang-dropdown {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.15);
    color: var(--text-dark);
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 8px 32px 8px 14px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 140px;
}

.lang-dropdown:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.15);
}

.lang-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.2);
}

[data-theme="dark"] .lang-dropdown {
    background-color: #2a2a2a;
    border-color: #444;
    color: var(--text-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23aaa'/%3E%3C/svg%3E");
}

[data-theme="dark"] .lang-dropdown option {
    background: #1e1e1e;
    color: var(--text-dark);
}

[data-theme="dark"] .filter-toggles {
    background: rgba(30,30,30,0.5) !important;
    border-color: #444 !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, hsla(28,100%,74%,0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(8,75%,60%,0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(40,100%,74%,0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

/* APP HEADER & PROGRESS */
.app-header {
    background: white;
    padding: 0.8rem 2rem; /* Reduced padding from 1rem */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h2 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 800;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-logo {
    height: 120px;
    width: auto;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
}

.app-logo:hover {
    transform: scale(1.05);
}

/* Progress indicator styles removed as per user request */

/* CONTAINER & WIZARD VIEWS */
.container {
    max-width: 1200px;
    margin: 20px auto; /* Reduced vertical margin from 40px */
    padding: 0 20px;
    min-height: 80vh;
}

.wizard-view {
    animation: fadeInScale 0.4s ease forwards;
}

.hidden-view { display: none !important; }
.active-view { display: block; }

@keyframes fadeInScale {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* HERO SECTION (VIEW 1) */
.hero-box {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 24px;
    padding: 3rem; /* Reduced from 5rem 3rem */
    text-align: center;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.hero-box h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--secondary);
    margin-bottom: 1rem; /* Reduced from 1.5rem */
    line-height: 1.1;
}

.hero-desc {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-subdesc {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto; margin-right: auto;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 2rem; /* Reduced from 3rem */
    margin-bottom: 3rem; /* Reduced from 4rem */
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.feature-item i {
    font-size: 3rem;
    color: var(--accent);
    background: #fff3e0;
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(243, 156, 18, 0.2);
}

.feature-item span {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.wizard-start-btn {
    font-size: 1.4rem !important;
    padding: 1.2rem 3rem !important;
    border-radius: 50px !important;
}

/* WIZARD COMMON */
.wizard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.wizard-header h2 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.wizard-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* INGREDIENT GRIDS */
.ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-heading {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--secondary);
    margin: 2rem 0 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-small {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.ing-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    will-change: transform;
}

.ing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: rgba(211, 84, 0, 0.3);
}

.ing-card.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(211, 84, 0, 0.3);
}

.card-icon {
    font-size: 3.5rem;
    color: var(--secondary);
    transition: var(--transition);
}

.emoji-icon {
    font-size: 3.5rem;
    display: block;
    line-height: 1;
    transition: var(--transition);
}

.ing-card.selected .card-icon {
    color: white;
}

.card-label {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
}

/* FOOTER ACTIONS */
.sticky-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.85); /* Sticky background */
    backdrop-filter: blur(12px); /* Premium blur effect */
    border-top: 1px solid rgba(0,0,0,0.05);
    border-radius: 0 0 16px 16px;
    position: sticky;
    bottom: 0;
    z-index: 90;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05); /* Shadow to separate from content below */
}

.center-footer {
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    border-radius: 16px; /* Full curved for main page */
}

.action-footer {
    align-items: flex-end;
}

.action-combo {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* BUTTONS */
button { font-family: var(--font-body); }

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.3);
    display: flex; align-items: center; gap: 10px;
}

.primary-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4);
}

.secondary-btn {
    background: white;
    color: var(--text-dark);
    border: 2px solid #ddd;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: center; gap: 10px;
}

.secondary-btn:hover {
    background: #f1f2f6;
    border-color: #bbb;
}

.small-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.spice-btn {
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex; align-items: center; gap: 10px;
}

.non-spicy-btn {
    background: #27ae60;
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.non-spicy-btn:hover {
    background: #219a52;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.all-spicy-btn {
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.all-spicy-btn:hover {
    background: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4);
}

/* RESULTS GRID */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    padding-bottom: 1rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.result-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border-top: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-img {
    height: 180px;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
}

.card-img.pdf-source {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.card-tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #f1f2f6;
    color: var(--text-light);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.veg-tag {
    background: #e8f8f5;
    color: #27ae60;
}

.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.no-results i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Spicy Fire VFX */
@keyframes fire-flicker {
    0% { filter: brightness(1) contrast(1); }
    30% { filter: brightness(1.1) contrast(1.1); box-shadow: inset 0 0 30px rgba(231, 76, 60, 0.3); }
    50% { filter: brightness(1.15) contrast(1.2); box-shadow: inset 0 0 40px rgba(243, 156, 18, 0.4); }
    80% { filter: brightness(1.05) contrast(1.05); }
    100% { filter: brightness(1) contrast(1); }
}

.spicy-fire-card {
    animation: fire-flicker 1.5s infinite alternate ease-in-out;
    z-index: 1;
}

/* Flame Icon Overlay */
.spicy-flame-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #f39c12;
    font-size: 1.8rem;
    z-index: 30;
    filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.8));
    animation: flamePulse 1s infinite alternate ease-in-out;
}

@keyframes flamePulse {
    0% { transform: scale(1) rotate(-5deg); }
    100% { transform: scale(1.2) rotate(5deg); }
}

/* Anime Typography Overlay (Refined) */
.main-ing-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    color: white;
    font-weight: 400; /* Bebas Neue is bold by default */
    font-size: 2.5rem;
    font-family: 'Bebas Neue', sans-serif;
    text-transform: uppercase;
    z-index: 25;
    letter-spacing: 1.5px;
    -webkit-text-stroke: 2px black;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.9);
    pointer-events: none;
    line-height: 1;
    animation: animeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes animeIn {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* MODAL: THE SPICE MANUAL STYLE & DEPENDENCIES */
.modal, .modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75); /* Darker overlay */
    backdrop-filter: blur(8px); /* Blur background */
    display: flex;
    align-items: center; /* PERFECT CENTERING */
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active, .modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    background: #fffdf9;
    width: 92%; max-width: 850px;
    max-height: 88vh;
    border-radius: 20px; /* More rounded */
    position: relative;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    transform: translateY(-50px) scale(0.95); /* Slide down effect */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 30px 50px;
}

.modal.active .modal-content, .modal-overlay.active .modal-content { 
    transform: translateY(0) scale(1); 
}

.close-btn {
    position: absolute; top: 20px; right: 20px;
    background: #f1f2f6; border: none;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer;
    transition: var(--transition); color: var(--text-dark);
}
.close-btn:hover { background: #ff7675; color: white; }

.manual-style {
    padding: 20px 0; color: var(--text-dark);
    font-family: 'Times New Roman', Times, serif; line-height: 1.8;
    font-size: 1.15rem;
}

.manual-style h1 {
    font-family: 'Arial', sans-serif; font-size: 2.8rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2;
    border-bottom: 3px solid var(--text-dark); padding-bottom: 12px; margin-bottom: 20px;
    word-wrap: break-word; overflow-wrap: break-word;
}

.manual-style .meta {
    font-style: italic; color: var(--text-light); margin-bottom: 35px;
    font-family: 'Arial', sans-serif; font-size: 1.2rem;
}

.manual-style h2 {
    font-family: 'Arial', sans-serif; font-size: 1.5rem; font-weight: 700;
    margin-top: 40px; margin-bottom: 22px; text-transform: uppercase;
}

.manual-style ul { list-style-type: none; margin-bottom: 25px; padding-left: 0; }
.manual-style li { margin-bottom: 12px; position: relative; padding-left: 25px; }
.manual-style li::before {
    content: "•"; position: absolute; left: 0;
    color: #d35400; font-weight: bold; font-size: 1.2rem;
}

.manual-style .step { margin-bottom: 20px; text-align: justify; }
.manual-style .step-title { font-weight: bold; font-family: 'Arial', sans-serif; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

@media (max-width: 1024px) {
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 2-3 columns on tablets */
    }
    .hero-box { padding: 4rem 2rem; }
    .hero-box h1 { font-size: 3.5rem; }
    .manual-style { padding: 40px; }
}

@media (max-width: 768px) {
    /* Container alignments */
    .container { padding: 0 15px; margin: 20px auto; }
    .app-header { 
        padding: 0.8rem 1rem; 
        flex-direction: column; 
        gap: 10px; 
    }
    .header-left, .header-center, .header-right {
        flex: none;
        width: 100%;
        justify-content: center;
    }
    .app-logo { height: 90px; }
    .app-header h2 { font-size: 1.5rem; }
    
    /* Hero Section */
    .hero-box { padding: 2.5rem 1.5rem; }
    .hero-box h1 { font-size: 2.5rem; }
    .hero-desc { font-size: 1.1rem; }
    .feature-item { width: 100%; flex-direction: row; text-align: left; }
    .feature-item i { width: 50px; height: 50px; font-size: 2rem; }
    
    /* Wizard / Typography */
    .wizard-header h2 { font-size: 2.2rem; }
    .wizard-header p { font-size: 1rem; }
    
    /* Grids scaling down intelligently */
    .ingredient-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
    .grid-small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .recipe-grid { grid-template-columns: 1fr; /* Strict 1 column for phones */ }
    
    /* Time Grid Fixes */
    .time-grid .ing-card { width: 100% !important; min-height: 140px; height: auto !important; }

    /* Modals & Layout */
    .wizard-footer { flex-direction: column; gap: 1.5rem; align-items: stretch; }
    .action-combo { flex-direction: column; }
    .manual-style { padding: 10px 0; }
    .manual-style h1 { font-size: 1.8rem; line-height: 1.1; margin-bottom: 15px; }
    .modal-content { width: 96%; max-height: 95vh; padding: 20px 15px; border-radius: 14px; box-sizing: border-box; overflow-x: hidden; }
    
    /* Dynamic filter buttons */
    #percentage-filters { justify-content: center; width: 100%; }
    .secondary-btn, .primary-btn { 
        padding: 0.8rem 1rem; 
        text-align: center; 
        justify-content: center; 
        flex: 1; /* Standardize width to share space equally */
        min-width: 0; 
        font-size: 0.95rem; /* Slightly smaller for long mobile text */
        border-radius: 12px;
        height: 54px; /* Consistent anchor height */
    }
    .sticky-action-bar {
        padding: 1rem;
        gap: 10px;
    }
    .center-footer {
        flex-direction: column;
        padding: 1.5rem;
    }
    .center-footer button {
        width: 100%;
        flex: none !important;
    }
    .wizard-start-btn {
        font-size: 1.25rem !important;
        padding: 1rem 2rem !important;
    }
    /* Modal buttons should not inherit rigid height/flex from the global mobile override */
    .modal-content .secondary-btn,
    .modal-content .primary-btn {
        height: auto;
        flex: none;
        min-width: auto;
        white-space: nowrap;
    }
    /* Community gallery header: wrap on narrow screens */
    .community-photos-section > div:first-child {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Performance optimizations for mobile */
    body {
        background-attachment: scroll;
    }
    .hero-box, .sticky-action-bar, .modal-overlay, .modal {
        backdrop-filter: none !important;
    }
    .hero-box, .sticky-action-bar {
        background: rgba(255, 255, 255, 0.98);
    }
    .modal-overlay, .modal {
        background: rgba(0, 0, 0, 0.9);
    }
    .spicy-fire-card, .spicy-flame-icon, .main-ing-overlay {
        animation: none !important;
    }
    .spicy-flame-icon {
        filter: none;
        text-shadow: 0 0 5px rgba(231, 76, 60, 0.8);
    }
    .ing-card, .result-card {
        will-change: auto; /* Reduce memory consumption on excessive cards */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* simpler shadow */
    }
    .ing-card:hover, .result-card:hover {
        transform: none; /* disable hover translation on mobile */
    }
}

.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
}
.floating-btn.visible {
    opacity: 1;
    pointer-events: auto;
}
.floating-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.6);
}

/* MATCH PERCENTAGE UI */
#percentage-filters .active-filter {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.match-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.95rem;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-card:hover .match-badge {
    opacity: 1;
    transform: translateY(0);
}

.match-100 { background: #27ae60; }
.match-high { background: #f39c12; }
.match-med { background: #e67e22; }
.match-low { background: #e74c3c; }

.missing-ingredients {
    background: #fff3f3;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}
.missing-ingredients h3 {
    color: #e74c3c;
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: bold;
}
.missing-ingredients p {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin: 0;
}

.photo-attribution {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 0.75rem;
    pointer-events: none;
    backdrop-filter: blur(4px);
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

[data-theme="dark"] .photo-attribution {
    background: rgba(255, 255, 255, 0.2);
    color: #f5f6fa;
}

/* GOOGLE TRANSLATE CUSTOMIZATION */
.custom-translate {
    display: flex;
    align-items: center;
}
body { top: 0 !important; }
.goog-te-banner-frame { display: none !important; }
.skiptranslate.goog-te-gadget {
    font-family: var(--font-body) !important;
    font-size: 0px !important; 
    color: transparent !important;
}
.skiptranslate.goog-te-gadget .goog-te-combo {
    font-family: var(--font-body) !important;
    font-size: 1rem !important;
    color: var(--text-dark) !important;
    background-color: var(--card-bg) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    padding: 8px 15px !important;
    border-radius: 20px !important;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.goog-logo-link { display: none !important; }
.goog-te-gadget span { display: none !important; }

/* DARK MODE FIXES */
[data-theme="dark"] .missing-ingredients {
    background: rgba(231, 76, 60, 0.1);
}
[data-theme="dark"] .missing-ingredients h3 {
    color: #ff6b6b;
}

/* FLOATING BACK-TO-TOP BUTTON */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: var(--secondary);
}

[data-theme="dark"] .floating-btn {
    background: var(--secondary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

[data-theme="dark"] .floating-btn:hover {
    background: var(--primary);
}

/* --- COMMUNITY GALLERY --- */

.community-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-gallery {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

/* --- LIGHTBOX --- */

.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- ADMIN MODERATION --- */

.admin-pending-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-pending-item {
    display: flex;
    gap: 20px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    align-items: center;
}

.admin-pending-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

[data-theme="dark"] .admin-pending-item {
    background: #2d2d2d;
    border-color: #444;
}

/* --- MONETIZATION: AD GUTTERS --- */

.ad-gutter {
    position: fixed;
    top: 180px;
    width: 160px;
    height: 600px; /* Standard skyscraper height */
    background: transparent;
    display: none; /* Hidden by default for mobile/small screens */
    z-index: 50;
    overflow: hidden;
    text-align: center;
}

.ad-left {
    left: calc(50% - 820px); /* Increased offset to provide 50px more gutter space */
}

.ad-right {
    right: calc(50% - 820px); /* Increased offset to provide 50px more gutter space */
}

/* Only show ads on ultra-wide screens to maintain premium feel */
@media screen and (min-width: 1580px) {
    .ad-gutter {
        display: block;
    }
}

/* Subtle label for the ad space */
.ad-gutter::before {
    content: "SPONSORED";
    display: block;
    font-size: 0.6rem;
    color: var(--text-light);
    margin: 15px 0 5px 0; /* Added top margin for better clearance */
    letter-spacing: 1px;
    opacity: 0.5;
    white-space: nowrap;
}

[data-theme="dark"] .ad-gutter::before {
    color: #888;
}
/* Shopping List Enhancements */
.shopping-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, border-color 0.2s;
    will-change: transform, opacity;
}

.shopping-item:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateX(5px);
}

.shopping-item span {
    font-size: 1.25rem; /* 10% larger than base */
    font-weight: 500;
    color: var(--text-dark);
}

.item-qty {
    font-weight: 700;
    color: var(--primary);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
}

.shopping-item:hover .custom-checkbox {
    border-color: var(--primary);
}

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

.custom-checkbox i {
    font-size: 0.85rem;
}

.shopping-item.checked {
    opacity: 0.5 !important;
}

.shopping-item.checked span {
    text-decoration: line-through !important;
    color: var(--text-light) !important;
}

.found-it-item-flash {
    animation: found-flash 0.8s ease-out;
}

@keyframes found-flash {
    0% { background-color: transparent; }
    30% { background-color: rgba(39, 174, 96, 0.2); transform: scale(1.02); }
    100% { background-color: transparent; transform: scale(1); }
}

.found-it-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed var(--border-color);
    transition: all 0.4s ease;
}

.found-it-section h3 {
    color: #27ae60 !important;
}

.found-it-section .aisle-icon {
    color: #27ae60 !important;
}

.aisle-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#load-more-btn {
    min-width: 200px;
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
    transition: all 0.3s ease;
}

#load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3);
}

#load-more-btn i {
    margin-right: 8px;
}

.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

.app-footer-legal {
    padding: 30px 20px 80px;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: transparent;
    text-align: center;
}

.footer-legal-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.copyright {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 400;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

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

@media (min-width: 768px) {
    .footer-legal-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* --- RESULTS HINT (TOAST) --- */
.results-hint {
    background: rgba(255, 107, 0, 0.1);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0 20px;
    font-size: 1rem;
    color: var(--text-dark);
    display: none; /* Injected via JS */
    animation: slideDown 0.4s ease-out;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.results-hint.visible {
    display: block;
}

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

[data-theme="dark"] .results-hint {
    background: rgba(255, 107, 0, 0.15);
    color: #f5f6fa;
}

/* --- FLAVOR PROGRESS BAR --- */
.flavor-progress-container {
    max-width: 500px;
    margin: 15px auto 25px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.flavor-progress-msg {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-family: var(--font-body);
}

.flavor-progress-msg strong {
    color: var(--primary);
}

.flavor-progress-bar-bg {
    width: 100%;
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.flavor-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f39c12, #e67e22, #e74c3c);
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

[data-theme="dark"] .flavor-progress-bar-bg {
    background: #3d3d3d;
}

[data-theme="dark"] .flavor-progress-container {
    background: #2d2d2d;
    border-color: #444;
}

/* --- ADDITIONAL DARK MODE FIXES --- */

[data-theme="dark"] .hero-box {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .feature-item i {
    background: rgba(243, 156, 18, 0.15);
}

[data-theme="dark"] .sticky-action-bar {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: #444;
}

[data-theme="dark"] .no-results {
    background: var(--card-bg);
}

[data-theme="dark"] .tag {
    background: #333;
    color: var(--text-light);
}

[data-theme="dark"] .veg-tag {
    background: rgba(39, 174, 96, 0.15);
    color: #2ecc71;
}

[data-theme="dark"] .shopping-item {
    border-color: #444;
}

[data-theme="dark"] .shopping-item:hover {
    background: #2a2a2a;
}

[data-theme="dark"] .custom-checkbox {
    background: #1e1e1e;
    border-color: #555;
}
