/* --- THEME CONTROL PANEL --- */
/* To change the entire website's color scheme, you only need to edit the values below.
   Each variable (--primary, --text-strong, etc.) controls a different part of the site's design.
   Simply replace the hex code (e.g., #F0BB78) with a new color code to update the theme.
   This is the ONLY section you need to modify for future color changes.
*/
:root {
    /* � VIBRIANT FOOD PALETTE */

    /* Primary Colors - Modern & Trustworthy */
    --primary: #6366F1;
    /* Indigo: Modern, trustworthy, and universally loved. */
    --primary-light: #818CF8;
    /* Light Indigo: Soft, approachable accent color. */
    --primary-dark: #4F46E5;
    /* Deep Indigo: Rich, professional hover effects. */

    /* Secondary Colors - Warm & Energetic */
    --secondary: #F59E0B;
    /* Amber: Warm, energetic, food-friendly accent. */
    --secondary-light: #FCD34D;
    /* Light Amber: Cheerful, optimistic highlights. */
    --accent: #10B981;
    /* Emerald: Fresh, success-oriented green. */

    /* Text Colors - Readable & Modern */
    --text-strong: #1F2937;
    /* Gray 800: Strong, readable dark text. */
    --text-dark: #374151;
    /* Gray 700: Perfect for body text. */
    --text-light: #6B7280;
    /* Gray 500: Subtle secondary text. */

    /* Background & Surface Colors - Clean & Modern */
    --bg: #F9FAFB;
    /* Gray 50: Clean, modern background. */
    --bg-alt: #F3F4F6;
    /* Gray 100: Subtle section differentiation. */
    --card-bg: #FFFFFF;
    /* Pure White: Clean, crisp cards. */

    /* Borders & Shadows - Soft & Modern */
    --border-light: #E5E7EB;
    /* Gray 200: Clean, modern borders. */
    --shadow-color: 31, 41, 55;
    /* RGB for --text-strong, modern shadow base. */
    --shadow-sm: 0 1px 2px 0 rgba(var(--shadow-color), 0.05);
    --shadow-md: 0 4px 6px -1px rgba(var(--shadow-color), 0.1), 0 2px 4px -1px rgba(var(--shadow-color), 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(var(--shadow-color), 0.1), 0 4px 6px -2px rgba(var(--shadow-color), 0.05);

    /* Typography */
    --primary-font: 'Gabarito', sans-serif;
    --body-font: 'Titillium Web', sans-serif;

    /* Misc */
    --border-radius-lg: 12px;
}

/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Titillium Web', sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--body-font);
    background: var(--bg);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- Modern Pill-Shaped Header --- */
.main-header {
    display: flex;
    justify-content: center;
    padding: 40px 20px 20px;
    z-index: 100;
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background-color: var(--card-bg);
    padding: 12px 20px;
    border-radius: 9999px;
    box-shadow: var(--shadow-md);
    width: 95%;
    max-width: 1100px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon-container {
    background-color: var(--text-dark);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-container svg {
    width: 22px;
    height: 22px;
    fill: var(--card-bg);
}

.logo-text {
    font-family: var(--primary-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-strong);
}

.social-media-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.social-media-links a {
    color: var(--text-light);
    transition: color 0.2s ease;
    display: inline-flex;
}

.social-media-links a:hover {
    color: var(--text-strong);
}

.social-media-links svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.nav-auth {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.nav-auth button {
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-auth #profile-btn {
    background-color: var(--text-dark);
    color: var(--card-bg);
}

.nav-auth #profile-btn:hover {
    background-color: var(--text-strong);
    transform: translateY(-1px);
}

.nav-auth #logout-btn {
    background-color: var(--text-dark);
    color: var(--card-bg);
}

.nav-auth #logout-btn:hover {
    background-color: var(--text-strong);
    transform: translateY(-1px);
}

/* --- Search Bar --- */
.search-container {
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    display: flex;
    padding: 0.75rem;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    max-width: fit-content;
}

.search-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.search-container button,
.search-container select {
    font-size: 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    height: 38px;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    color: var(--text-dark);
}

.search-container select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

#single-random-meal {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
}

#single-random-meal:hover {
    background: var(--text-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .search-container {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .search-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-container button,
    .search-container select {
        width: 100%;
        padding: 0.75rem 1rem;
        height: auto;
    }
}


/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Category Showcase Section --- */
.category-showcase {
    width: 100%;
    margin-top: 4rem;
    padding: 0 1rem;
}

.category-title {
    font-family: var(--primary-font);
    font-size: 2.2rem;
    color: var(--text-strong);
    margin-bottom: 1rem;
    border-left: 5px solid var(--primary);
    padding-left: 1rem;
}

/* --- Meal Sliders & Grids --- */
.meal-slider-container {
    display: flex;
    gap: 32px;
    padding: 1rem 0;
    overflow-x: auto;
    margin: 20px 0;
    width: 100%;
    scrollbar-width: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.meal-slider-container.loaded {
    opacity: 1;
}

.meal-slider-container::-webkit-scrollbar {
    display: none;
}

/* --- Skeleton Loading --- */
.skeleton-container {
    display: flex;
    gap: 32px;
    padding: 1rem 0;
    margin: 20px 0;
    width: 100%;
}

.skeleton-card {
    flex: 0 0 280px;
    height: 350px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: skeleton-spin 1s linear infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes skeleton-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    width: 100%;
    padding: 0 32px;
    margin: 20px auto;
}

.random-meal-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2rem;
}

.random-meal-container .meal-card {
    width: 100%;
    max-width: 450px;
}

.meal-card {
    position: relative;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    aspect-ratio: 4 / 5;
    width: 280px;
    background-color: var(--card-bg);
}

.meal-slider-container .meal-card {
    flex: 0 0 280px;
}

.meal-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.meal-card-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}

.meal-card:hover .meal-card-background {
    transform: scale(1.1) rotate(2deg);
}

.meal-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(19, 16, 16, 0.9) 10%, transparent 100%);
    padding: 1.5rem;
    color: white;
}

.meal-card-info {
    transform: translateY(calc(100% - 4.5rem));
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.meal-card:hover .meal-card-info {
    transform: translateY(0);
}

.meal-card-title {
    font-family: var(--primary-font);
    font-size: 1.4rem;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    /* Make cards smaller on mobile */
    .meal-card {
        width: 240px;
        aspect-ratio: 3.5 / 4.5;
    }
    
    .meal-slider-container .meal-card {
        flex: 0 0 240px;
    }
    
    .meal-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
        padding: 0 20px;
    }
    
    /* Move title down and adjust overlay */
    .meal-card-overlay {
        padding: 1.2rem;
    }
    
    .meal-card-info {
        transform: translateY(calc(100% - 3rem));
    }
    
    /* Responsive title sizing for long names */
    .meal-card-title {
        font-size: clamp(1.1rem, 3vw, 1.3rem);
        line-height: 1.2;
        margin: 0.3rem 0 0.4rem 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        hyphens: auto;
    }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
    .meal-card {
        width: 200px;
        aspect-ratio: 3 / 4;
    }
    
    .meal-slider-container .meal-card {
        flex: 0 0 200px;
    }
    
    .meal-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        padding: 0 16px;
    }
    
    .meal-card-overlay {
        padding: 1rem;
    }
    
    .meal-card-info {
        transform: translateY(calc(100% - 2.5rem));
    }
    
    .meal-card-title {
        font-size: clamp(1rem, 3.5vw, 1.2rem);
        margin: 0.2rem 0 0.3rem 0;
    }
}

.meal-card-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.meal-card:hover .meal-card-cta {
    opacity: 1;
}

.meal-card-cta::after {
    content: '→';
    margin-left: 0.5rem;
    transition: margin-left 0.2s ease;
}

.meal-card:hover .meal-card-cta::after {
    margin-left: 1rem;
}

/* --- Toast Loader --- */
#toast-loader {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    display: none;
    align-items: center;
    background: var(--card-bg);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

#toast-loader span {
    margin-left: 12px;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Modern Recipe Modal --- */
.recipe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.recipe-modal.show {
    display: flex;
}

/* Ensure close button is positioned relative to the modal */
.recipe-modal .close-modal-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1001;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    grid-template-areas:
        "primary secondary"
        "instructions instructions";
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.recipe-primary-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    color: white;
    grid-area: primary;
}

.recipe-image {
    width: 100%;
    height: 250px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    margin-bottom: 1.5rem;
}

.recipe-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.recipe-tags span {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.recipe-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.recipe-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #FF0000;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.recipe-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.recipe-secondary-content {
    padding: 2rem;
    background: var(--card-bg);
    min-height: 0;
    grid-area: secondary;
}

.recipe-instructions-section {
    padding: 2rem;
    background: var(--card-bg);
    grid-area: instructions;
    border-top: 1px solid var(--border-light);
}

.recipe-secondary-content .recipe-title {
    font-family: 'Gabarito', sans-serif;
    font-size: 2.2rem;
    color: var(--text-strong);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 0.75rem;
}

.recipe-section-title {
    font-size: 1.3rem;
    color: var(--text-strong);
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.recipe-ingredients-list {
    list-style: none;
    padding: 0;
    background: var(--bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.recipe-ingredients-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
}

.recipe-ingredients-list li:last-child {
    border-bottom: none;
}

.recipe-ingredients-list li::before {
    content: '🥄';
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.ingredient-name {
    font-weight: 600;
    color: var(--text-strong);
    flex: 1;
}

.ingredient-amount {
    color: var(--text-light);
    font-weight: 500;
    background: var(--border-light);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.recipe-instructions-text {
    line-height: 1.8;
    color: var(--text-dark);
    font-size: 1rem;
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    white-space: pre-line;
    /* Preserves line breaks and spacing */
}

/* Style for formatted instruction steps */
.instruction-step {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.step-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    min-width: 2rem;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.6;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-alt);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "primary"
            "secondary"
            "instructions";
        max-height: 90vh;
        margin: 1rem;
        border-radius: 16px;
    }

    .recipe-primary-content {
        padding: 1.25rem;
    }

    /* Mobile close button positioning */
    .recipe-modal .close-modal-btn {
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .recipe-image {
        height: 220px;
        border-radius: 12px;
    }

    .recipe-secondary-content {
        padding: 1.25rem;
    }

    .recipe-instructions-section {
        padding: 1.25rem;
    }

    .recipe-secondary-content .recipe-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .recipe-section-title {
        font-size: 1.2rem;
        margin: 1.5rem 0 1rem 0;
    }

    .recipe-instructions-text {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 1rem;
    }

    .instruction-step {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .step-number {
        font-size: 1rem;
        min-width: 1.5rem;
    }

    .recipe-ingredients-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .recipe-ingredients-list li {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .recipe-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .recipe-actions button,
    .recipe-actions a {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .close-modal-btn {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* --- Testimonials Section --- */
.testimonials-section {
    width: 100%;
    padding: 4rem 0;
    background-color: var(--bg-alt);
    overflow: hidden;
    margin-top: 4rem;
    position: relative;
}

.testimonials-title {
    font-family: 'Gabarito', sans-serif;
    font-size: 2.5rem;
    color: var(--text-strong);
    text-align: center;
    margin-bottom: 2.5rem;
}

.testimonial-slider {
    width: 100%;
    display: flex;
    margin-bottom: 1.5rem;
}

.testimonial-track-left,
.testimonial-track-right {
    display: flex;
    gap: 1.5rem;
    animation-duration: 40s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.testimonial-track-left {
    animation-name: scroll-left;
}

.testimonial-track-right {
    animation-name: scroll-right;
}

.testimonial-slider:hover .testimonial-track-left,
.testimonial-slider:hover .testimonial-track-right {
    animation-play-state: paused;
}

.testimonial-card {
    flex: 0 0 320px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
    transition: background-color 0.3s ease;
}

.testimonial-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.testimonial-card .testimonial-author {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.testimonial-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-light);
}

.testimonial-card .testimonial-author {
    color: var(--primary);
}

.testimonial-track-left .testimonial-card:nth-child(2n),
.testimonial-track-right .testimonial-card:nth-child(2n) {
    background-color: #FEFBF6;
}

.testimonials-section::before,
.testimonials-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}

.testimonials-section::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-alt) 20%, transparent);
}

.testimonials-section::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-alt) 20%, transparent);
}

/* --- Enhanced Footer --- */
.main-footer {
    background: linear-gradient(135deg, var(--text-dark) 0%, #2d1810 100%);
    color: var(--bg-alt);
    padding: 4rem 2rem 0;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Brand Section */
.footer-brand {
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.footer-logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.footer-logo-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.footer-brand-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--card-bg);
    font-family: 'Gabarito', sans-serif;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.footer-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer Titles */
.footer-title {
    font-size: 1.1rem;
    color: var(--card-bg);
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}

.footer-links li a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-links li a::before {
    content: '→';
    margin-right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-links li a:hover::before {
    opacity: 1;
}

/* Social Links */
.footer-social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.footer-social-links a {
    color: var(--text-dark);
    font-size: 1.2rem;
    background: var(--card-bg);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.footer-social-links a:hover {
    background: var(--primary);
    color: var(--card-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Contact Section */
.footer-contact {
    margin-top: 1rem;
}

.contact-title {
    font-size: 1rem;
    color: var(--card-bg);
    margin-bottom: 1rem;
    font-weight: 600;
}

.developer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.developer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.developer strong {
    color: var(--card-bg);
    font-size: 0.9rem;
}

.developer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.developer a:hover {
    color: var(--primary-dark);
    transform: translateX(3px);
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

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

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-stats {
        justify-content: center;
    }

    .footer-social-links {
        justify-content: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-bottom-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 3rem 1rem 0;
    }

    .footer-stats {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* --- What's in my Fridge Button --- */
#pantry-search-btn {
    position: relative;
    background: linear-gradient(45deg, #2BC0E4 0%, #EAECC6 25%, #FF6B6B 50%, #4ECDC4 75%, #2BC0E4 100%);
    background-size: 300% 300%;
    color: white;
    font-weight: 700;
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(43, 192, 228, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: gradientFlow 4s ease-in-out infinite;
    overflow: hidden;
}

#pantry-search-btn::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.1), transparent 50%);
    border-radius: inherit;
    animation: shimmer 2s ease-in-out infinite alternate;
}

#pantry-search-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 45px rgba(43, 192, 228, 0.5);
    animation: gradientFlow 2s ease-in-out infinite, pulse 1s ease-in-out infinite alternate;
}

#pantry-search-btn:hover::before {
    animation: shimmer 1s ease-in-out infinite alternate, sparkle 0.8s ease-in-out infinite;
}

#pantry-search-btn:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 15px 45px rgba(43, 192, 228, 0.5);
    }

    100% {
        box-shadow: 0 15px 45px rgba(43, 192, 228, 0.8), 0 0 30px rgba(234, 236, 198, 0.4);
    }
}

@keyframes sparkle {

    0%,
    100% {
        background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent 50%),
            radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.2), transparent 50%);
    }

    50% {
        background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.4), transparent 50%),
            radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.2), transparent 50%);
    }
}

/* --- Pantry Modal & Results --- */
.pantry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--shadow-color), 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    /* Initially hidden */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.pantry-modal.show {
    display: flex;
    /* Shown with JavaScript */
}

/* --- FIXED: Added missing styles for modal content --- */
.pantry-modal-content {
    background: var(--bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    position: relative;
    padding: 2.5rem;
    animation: slideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pantry-modal-title {
    font-family: 'Gabarito', sans-serif;
    font-size: 2.2rem;
    color: var(--text-strong);
    margin-bottom: 0.5rem;
}

.pantry-modal-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.pantry-input-container {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#pantry-ingredient-input {
    flex-grow: 1;
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

#pantry-ingredient-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

#add-ingredient-btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary);
    color: var(--text-strong);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

#add-ingredient-btn:hover {
    background-color: var(--text-strong);
    color: var(--primary);
}

.pantry-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    min-height: 50px;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-alt);
    border: 1px dashed var(--border-light);
    border-radius: 8px;
}

.ingredient-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--border-light);
    color: var(--text-dark);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.ingredient-tag button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0;
    line-height: 1;
}

.pantry-search-action {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    border: none;
    background-color: var(--text-dark);
    color: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.pantry-search-action:hover {
    background-color: var(--text-strong);
}

.pantry-search-action:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #888;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#pantry-results-container {
    position: relative;
    /* Needed for the ::before pseudo-element */
    z-index: 1;
    /* Ensures content stays on top of the new background */
    border-radius: 0;
    /* Remove radius for a full-width block */
    padding-top: 2.5rem;
    /* Increased padding for better visual spacing */
    padding-bottom: 3rem;
}

#pantry-results-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Places the background behind the content */
    background: linear-gradient(-45deg, #F0BB78, #c48c48, #543A14, #F0BB78);
    background-size: 400% 400%;
    animation: gradient-flow 15s ease-in-out infinite;
}

#pantry-results-container .category-title {
    color: #fff;
    border-left: 5px solid rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* Keyframes & Responsive */
@keyframes scroll-left {
    100% {
        transform: translateX(calc(-320px * 5 - 1.5rem * 5));
    }
}

@keyframes scroll-right {
    0% {
        transform: translateX(calc(-320px * 5 - 1.5rem * 5));
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Header adjustments */
    .main-header {
        padding: 20px 15px 15px;
    }

    .navbar {
        width: 100%;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon-container {
        width: 35px;
        height: 35px;
    }

    .logo-icon-container svg {
        width: 18px;
        height: 18px;
    }

    .navbar {
        grid-template-columns: auto 1fr;
        gap: 1rem;
    }

    .nav-auth {
        gap: 8px;
        justify-content: flex-end;
        /* Keep buttons on the right side */
    }

    .nav-auth button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .social-media-links {
        display: none;
        /* Hide social links on mobile to save space */
    }

    /* Typography adjustments */
    .category-title,
    .testimonials-title,
    .recipe-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    /* Slider adjustments for mobile */
    .meal-slider-container {
        gap: 20px;
        padding: 0.75rem 0;
        margin: 15px 0;
    }

    .meal-card {
        width: 240px;
        aspect-ratio: 4 / 5;
    }

    .meal-slider-container .meal-card {
        flex: 0 0 240px;
    }

    /* Category sections */
    .category-showcase {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    /* Testimonials */
    .testimonials-section {
        padding: 2rem 0;
        margin-top: 2rem;
    }

    .testimonials-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }

    .testimonial-card {
        flex: 0 0 280px;
        padding: 1rem;
        font-size: 0.9rem;
    }

    .testimonial-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .testimonial-track-left,
    .testimonial-track-right {
        gap: 1rem;
    }

    .testimonials-section::before,
    .testimonials-section::after {
        width: 50px;
    }



    /* Filter container mobile */
    #filter-value-container {
        width: 100%;
    }

    /* Pantry search mobile */
    .pantry-search-section {
        padding: 1.5rem 1rem;
    }

    /* Animations for smaller cards */
    @keyframes scroll-left {
        100% {
            transform: translateX(calc(-240px * 5 - 1rem * 5));
        }
    }

    @keyframes scroll-right {
        0% {
            transform: translateX(calc(-240px * 5 - 1rem * 5));
        }
    }
}

@media (max-width: 480px) {

    /* Extra small mobile adjustments */
    .main-header {
        padding: 15px 10px 10px;
    }

    .navbar {
        padding: 8px 12px;
        border-radius: 20px;
        grid-template-columns: auto 1fr;
        gap: 0.5rem;
    }

    .nav-auth {
        gap: 6px;
        justify-content: flex-end;
    }

    .nav-auth button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-icon-container {
        width: 30px;
        height: 30px;
    }

    .logo-icon-container svg {
        width: 16px;
        height: 16px;
    }

    .nav-auth button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .category-title,
    .testimonials-title,
    .recipe-title {
        font-size: 1.4rem;
    }

    .category-showcase {
        padding: 1rem 0.75rem;
    }

    .meal-card {
        width: 200px;
    }

    .meal-slider-container .meal-card {
        flex: 0 0 200px;
    }

    .meal-slider-container {
        gap: 16px;
    }

    /* Testimonials for very small screens */
    .testimonials-section {
        padding: 1.5rem 0;
    }

    .testimonials-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }

    .testimonial-card {
        flex: 0 0 250px;
        padding: 0.75rem;
        margin: 0 0.25rem;
    }

    .testimonial-card p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }

    .testimonial-card .testimonial-author {
        font-size: 0.8rem;
    }

    .testimonials-section::before,
    .testimonials-section::after {
        width: 30px;
    }

    /* Slower animation for better readability on small screens */
    .testimonial-track-left,
    .testimonial-track-right {
        animation-duration: 60s;
    }



    /* Animations for extra small cards */
    @keyframes scroll-left {
        100% {
            transform: translateX(calc(-200px * 5 - 0.8rem * 5));
        }
    }

    @keyframes scroll-right {
        0% {
            transform: translateX(calc(-200px * 5 - 0.8rem * 5));
        }
    }
}


/* --- Featured Recipe Section (for single random meal) --- */
.featured-recipe-section {
    background-color: var(--bg-alt);
    padding: 2.5rem 1rem;
    border-radius: var(--border-radius-lg);
}

.featured-recipe-section .category-title {
    text-align: center;
    border-left: none;
    margin-bottom: 2rem;
}

.random-meal-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.random-meal-content .meal-card {
    width: 100%;
    max-width: 400px;
    /* A good size for a featured item */
}


/* =============================================== */
/* ======== Manual Search Results Style ======== */
/* =============================================== */

#manual-search-container {
    position: relative;
    z-index: 1;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

#manual-search-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Using the dark colors from your theme for a rich, black feel */
    background: linear-gradient(-45deg, var(--text-strong), #2d2012, var(--text-strong));
    background-size: 400% 400%;
    animation: gradient-flow 18s ease-in-out infinite;
}

#manual-search-container .category-title {
    color: var(--card-bg);
    /* White text for high contrast */
    border-left-color: rgba(255, 255, 255, 0.8);
    /* Lighter border */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* --
- Bookmark Styles --- */
.bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.bookmark-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.bookmark-btn i {
    font-size: 18px;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.bookmark-btn.bookmarked i {
    color: #e74c3c;
}

.bookmark-btn.bookmarked:hover i {
    color: #c0392b;
}

/* Modal bookmark button */
.modal-bookmark {
    position: static;
    width: auto;
    height: auto;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-bookmark:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-bookmark.bookmarked {
    background: rgba(231, 76, 60, 0.9);
    border-color: rgba(231, 76, 60, 0.5);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.modal-bookmark.bookmarked:hover {
    background: rgba(192, 57, 43, 0.9);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.4);
}

.modal-bookmark i {
    font-size: 16px;
}

/* Recipe actions container */
.recipe-actions {
    display: flex;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}



/* Ensure meal cards have relative positioning for absolute bookmark buttons */
.meal-card {
    position: relative;
}

/* Responsive bookmark button */
@media (max-width: 768px) {
    .bookmark-btn {
        width: 38px;
        height: 38px;
        top: 10px;
        right: 10px;
    }

    .bookmark-btn i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bookmark-btn {
        width: 35px;
        height: 35px;
        top: 8px;
        right: 8px;
    }

    .bookmark-btn i {
        font-size: 14px;
    }
}

.modal-bookmark {
    padding: 10px 16px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
        border-radius: 12px;
    }

    .recipe-primary-content,
    .recipe-secondary-content,
    .recipe-instructions-section {
        padding: 1rem;
    }

    .recipe-image {
        height: 180px;
    }

    .recipe-secondary-content .recipe-title {
        font-size: 1.3rem;
    }

    .recipe-section-title {
        font-size: 1.1rem;
    }

    .recipe-instructions-text {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .instruction-step {
        margin-bottom: 0.75rem;
        gap: 0.4rem;
    }

    .step-number {
        font-size: 0.9rem;
        min-width: 1.2rem;
    }

    .step-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .recipe-ingredients-list li {
        font-size: 0.85rem;
        padding: 0.4rem;
    }

    .close-modal-btn {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}

/* P
antry Modal Mobile Responsiveness */
@media (max-width: 768px) {
    .pantry-modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        padding: 2rem 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
    }

    .pantry-modal-title {
        font-size: 1.8rem;
    }

    .pantry-modal-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .pantry-input-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pantry-input-container input {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .pantry-input-container button {
        width: 100%;
        padding: 0.75rem;
    }

    .pantry-tags {
        gap: 0.5rem;
        margin: 1rem 0;
    }

    .ingredient-tag {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .pantry-search-btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .pantry-modal-content {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
        max-height: 90vh;
    }

    .pantry-modal-title {
        font-size: 1.6rem;
    }

    .pantry-modal-subtitle {
        font-size: 0.9rem;
    }

    .ingredient-tag {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    .close-modal-btn {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {

    /* Larger touch targets */
    .meal-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    }

    .bookmark-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Simple mobile scroll optimization */
    .meal-slider-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Disable transitions during scroll for better performance */
    .meal-card {
        transition: none;
    }

    .meal-card-background {
        transition: none;
    }

    /* Improved button spacing */
    .nav-auth button {
        min-height: 44px;
        /* iOS recommended touch target */
        touch-action: manipulation;
    }
}

/* Recipe Details Section */
.recipe-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.recipe-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.recipe-detail-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recipe-detail-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}

/* Difficulty level colors */
.difficulty-beginner {
    color: #28a745;
}

.difficulty-intermediate {
    color: #ffc107;
}

.difficulty-expert {
    color: #dc3545;
}

/* Mobile responsive recipe details */
@media (max-width: 768px) {
    .recipe-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1rem 0;
        padding: 1rem;
    }

    .recipe-detail-item {
        padding: 0.5rem;
    }

    .recipe-detail-item i {
        font-size: 1.25rem;
        margin-bottom: 0.4rem;
    }

    .detail-label {
        font-size: 0.75rem;
    }

    .detail-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .recipe-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .recipe-detail-item {
        padding: 0.4rem;
    }

    .recipe-detail-item i {
        font-size: 1.1rem;
    }

    .detail-label {
        font-size: 0.7rem;
    }

    .detail-value {
        font-size: 0.85rem;
    }
}

/* Seasonal and Trending Sections */
.seasonal-section,
.trending-section {
    background: none;
    /* Background is removed from the container */
    border-radius: 0;
    /* Removed border-radius for the full-width effect */
    padding: 2.5rem 0;
    /* Adjusted padding for vertical spacing, horizontal is handled by parent */
    margin: 2rem 0;
    position: relative;
}

/* This new rule creates the full-width background for both sections */
.seasonal-section::before,
.trending-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    /* This makes the background span the full viewport width */
    height: 100%;
    z-index: -1;
    /* Place the background behind the content */
    pointer-events: none;
}

/* Apply the specific orange gradient to the seasonal section's new background */
.seasonal-section::before {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
}

/* Apply the specific purple gradient to the trending section's new background */
.trending-section::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* The original decorative elements have been moved from ::before to ::after */
.seasonal-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s linear infinite;
    pointer-events: none;
}

.trending-section::after {
    content: '🔥';
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 3rem;
    opacity: 0.3;
    animation: pulse-fire 2s ease-in-out infinite;
}

/* These title styles are correct and have not been changed */
.seasonal-section .category-title {
    color: white;
    border-left-color: rgba(255, 255, 255, 0.8);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.trending-section .category-title {
    color: white;
    border-left-color: rgba(255, 255, 255, 0.8);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }

    100% {
        transform: translateY(0px) rotate(360deg);
    }
}

@keyframes pulse-fire {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

/* Season-specific styling */
.season-spring {
    background: linear-gradient(135deg, #a8e6cf 0%, #7fcdcd 100%);
}

.season-summer {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
}

.season-autumn {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
}

.season-winter {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

/* Mobile responsive for new sections */
@media (max-width: 768px) {

    .seasonal-section,
    .trending-section {
        padding: 2rem 1rem;
        margin: 1.5rem 0;
    }

    .seasonal-section::before,
    .trending-section::before {
        /* Keep full-width backgrounds on mobile */
        width: 100vw;
    }

    .trending-section::after {
        font-size: 2rem;
        top: 0.5rem;
        right: 1rem;
    }

    .trending-section::before {
        font-size: 2rem;
        top: 0.5rem;
        right: 1rem;
    }
}

/* Trend
ing Badge */
.trending-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(45deg, #ff6b35, #ff9a56);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    animation: trending-pulse 2s ease-in-out infinite;
}

@keyframes trending-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Mobile responsive trending badge */
@media (max-width: 768px) {
    .trending-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        top: 8px;
        left: 8px;
    }
}

/* ===
============== Authentication Guard Styles ================= */

/* Login Prompt Overlay */
#auth-prompt {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    animation: slideInRight 0.5s ease-out;
}

.auth-prompt-content {
    padding: 1.5rem;
    position: relative;
}

.auth-prompt-icon {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.auth-prompt-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.auth-prompt-content p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

.auth-prompt-features {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.auth-prompt-features h4 {
    margin: 0 0 0.75rem 0;
    color: var(--primary);
    font-size: 1rem;
}

.auth-prompt-features ul li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-prompt-features ul li strong {
    color: var(--primary);
}

.auth-prompt-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.auth-prompt-content li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.auth-prompt-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-prompt-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.auth-prompt-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.auth-prompt-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Authentication Required Modal */
.auth-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.auth-modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease-out;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    background: var(--bg-alt);
    color: var(--text-strong);
}

.auth-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.auth-modal-content h2 {
    color: var(--text-strong);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.auth-modal-content p {
    color: var(--text-dark);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.auth-modal-benefits {
    background: var(--bg-alt);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.auth-modal-benefits h4 {
    color: var(--text-strong);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.auth-modal-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-modal-benefits li {
    padding: 0.5rem 0;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.auth-modal-testimonial {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.auth-modal-testimonial strong {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    color: var(--primary);
}

.auth-modal-benefits h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.auth-modal-benefits ul li {
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
}

.auth-modal-benefits ul li strong {
    color: var(--text-strong);
}

.auth-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-modal-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
}

.auth-modal-btn.primary {
    background: var(--primary);
    color: white;
}

.auth-modal-btn.primary:hover {
    background: var(--text-strong);
    color: var(--primary);
    transform: translateY(-2px);
}

.auth-modal-btn.secondary {
    background: var(--bg-alt);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.auth-modal-btn.secondary:hover {
    background: var(--border-light);
    color: var(--text-strong);
}

/* Limited Access Indicators */
[data-requires-auth="true"]::after {
    content: '🔒';
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #auth-prompt {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .auth-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .auth-modal-actions {
        flex-direction: column;
    }
}

/* Modern Admin Dashboard Animations */
@keyframes backdropFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(180deg);
    }

    100% {
        transform: translateY(0px) rotate(360deg);
    }
}

/* ====
============= Admin Dashboard Styles ================= */

/* Modern Admin Navigation Button */
.admin-nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-right: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.admin-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.admin-nav-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.admin-nav-btn:hover::before {
    left: 100%;
}

/* Modern Glassmorphism Admin Dashboard Modal */
.admin-dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: backdropFadeIn 0.5s ease-out;
}

.admin-dashboard-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    width: 95%;
    max-width: 1300px;
    height: 90%;
    max-height: 850px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s linear infinite;
    pointer-events: none;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.admin-close-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    z-index: 1;
}

.admin-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Modern Glassmorphism Tabs */
.admin-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.admin-tab {
    flex: 1;
    padding: 1.2rem 1.5rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-bottom: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.admin-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.admin-tab:hover::before {
    opacity: 1;
}

.admin-tab.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: #f093fb;
    box-shadow: 0 -2px 20px rgba(240, 147, 251, 0.3);
}

.admin-tab.active::before {
    opacity: 1;
}

/* Modern Admin Content */
.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.admin-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.admin-tab-content {
    display: none;
    animation: contentFadeIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.admin-tab-content.active {
    display: block;
}

/* Modern Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(240, 147, 251, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.stat-info {
    position: relative;
    z-index: 1;
}

.stat-info h3 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-info p {
    margin: 0.5rem 0 0 0;
    opacity: 0.8;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Analytics Section */
.analytics-section {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
    font-size: 1.2rem;
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-label {
    min-width: 150px;
    color: var(--text-dark);
    font-weight: 600;
}

.metric-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-alt);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-value {
    min-width: 50px;
    text-align: right;
    font-weight: 700;
    color: var(--primary);
}

/* User Management */
.user-management {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.user-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.user-table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 8px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.5rem;
}

.user-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s ease;
}

.user-row:hover {
    background: var(--bg-alt);
}

.user-name {
    font-weight: 600;
    color: var(--text-strong);
}

.user-email {
    color: var(--text-dark);
}

.user-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-bookmarks {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* System Info */
.system-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.system-stats,
.system-actions {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.system-stats h3,
.system-actions h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
    font-size: 1.2rem;
}

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: 8px;
}

.status-label {
    font-weight: 600;
    color: var(--text-dark);
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-indicator.online {
    background: var(--accent);
    color: white;
}

.status-value {
    color: var(--text-light);
    font-size: 0.9rem;
}

.system-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.system-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.system-btn.danger {
    background: #e74c3c;
}

.system-btn.danger:hover {
    background: #c0392b;
}

.loading,
.error,
.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.error {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.error h4 {
    margin: 0 0 0.5rem 0;
    color: #e74c3c;
    font-style: normal;
}

.error p {
    margin: 0.5rem 0;
    font-style: normal;
    font-size: 0.9rem;
}

.no-data {
    background: var(--bg-alt);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    color: var(--text-dark);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-dashboard-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .admin-header {
        border-radius: 0;
        padding: 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .system-info {
        grid-template-columns: 1fr;
    }

    .user-table-header,
    .user-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .user-actions {
        flex-direction: column;
    }
}

/* --- ADMIN DASHBOARD STYLES --- */
.admin-dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.admin-dashboard-content {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.admin-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.admin-tabs {
    display: flex;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-light);
}

.admin-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.admin-tab:hover {
    background: var(--card-bg);
    color: var(--primary);
}

.admin-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Admin Navigation Button */
.admin-nav-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav-btn:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

/* Analytics Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-alt) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 50%;
    color: white;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--text-strong);
}

.stat-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.analytics-section {
    background: var(--bg-alt);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
}

.analytics-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-label {
    flex: 0 0 150px;
    font-weight: 600;
    color: var(--text-dark);
}

.metric-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-value {
    flex: 0 0 50px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

/* User Management Styles */
.user-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-action-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.user-table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--text-strong);
    border-bottom: 2px solid var(--border-light);
}

.user-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.user-row:hover {
    background: var(--bg-alt);
}

.user-name {
    font-weight: 600;
    color: var(--text-strong);
}

.user-email {
    color: var(--text-dark);
}

.user-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-bookmarks {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* System Info Styles */
.system-stats {
    background: var(--bg-alt);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.system-stats h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
}

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    color: var(--text-dark);
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-indicator.online {
    background: #D1FAE5;
    color: #065F46;
}

.status-value {
    color: var(--text-light);
    font-weight: 500;
}

.system-actions h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
}

.system-btn {
    background: var(--text-dark);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.system-btn:hover {
    background: var(--text-strong);
    transform: translateY(-2px);
}

.system-btn.danger {
    background: #EF4444;
}

.system-btn.danger:hover {
    background: #DC2626;
}

/* --- THEME MANAGEMENT STYLES --- */
.theme-management {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.theme-section {
    background: var(--bg-alt);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.theme-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.color-group h4 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    font-size: 1rem;
}

.color-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.color-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-input-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.color-input-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-input-group input[type="color"]:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.color-hex {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.color-hex:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.typography-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.font-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.font-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.font-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.layout-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.layout-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layout-group label {
    font-weight: 600;
    color: var(--text-dark);
}

.layout-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
    outline: none;
    cursor: pointer;
}

.layout-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.layout-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.range-value {
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    padding: 0.25rem 0.5rem;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.9rem;
}

.preset-themes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.preset-theme-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.preset-theme-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-preview {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
}

.preview-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-theme-btn span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.theme-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--border-radius-lg);
    margin-top: 2rem;
}

.theme-action-btn {
    background: var(--text-dark);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.theme-action-btn:hover {
    background: var(--text-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-action-btn.primary {
    background: var(--primary);
}

.theme-action-btn.primary:hover {
    background: var(--primary-dark);
}

.theme-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(2px);
    z-index: 2500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    pointer-events: none;
}

.preview-notice {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
}

.preview-notice button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.preview-notice button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    background: var(--bg-alt);
    border-radius: 8px;
    border: 2px dashed var(--border-light);
}

.error {
    text-align: center;
    padding: 2rem;
    color: #DC2626;
    background: #FEF2F2;
    border-radius: 8px;
    border: 1px solid #FECACA;
}

.error h4 {
    margin: 0 0 1rem 0;
    color: #991B1B;
}

.error p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-dashboard-modal {
        padding: 1rem;
    }

    .admin-dashboard-content {
        max-height: 95vh;
    }

    .admin-header {
        padding: 1.5rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-tabs {
        flex-direction: column;
    }

    .admin-tab {
        text-align: center;
        border-bottom: 1px solid var(--border-light);
        border-right: none;
    }

    .admin-tab.active {
        border-bottom-color: var(--primary);
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .color-inputs {
        grid-template-columns: 1fr;
    }

    .typography-controls,
    .layout-controls {
        grid-template-columns: 1fr;
    }

    .preset-themes {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-actions {
        flex-direction: column;
    }

    .user-table-header,
    .user-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .user-table-header {
        display: none;
    }

    .user-row {
        background: var(--bg-alt);
        border-radius: 8px;
        margin-bottom: 0.5rem;
        padding: 1rem;
    }

    .user-row::before {
        content: 'User: ';
        font-weight: 600;
        color: var(--text-light);
    }
}

@media (max-width: 480px) {
    .admin-header h2 {
        font-size: 1.2rem;
    }

    .preset-themes {
        grid-template-columns: 1fr;
    }

    .theme-actions {
        gap: 0.5rem;
    }

    .theme-action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}