:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --dark: #2C3E50;
    --light: #F7F9FC;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --card-bg: rgba(255, 255, 255, 0.7);
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    background-color: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgb(255, 200, 200) 0%, rgb(255, 252, 252) 90%);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    text-align: center;
    padding: 4rem 0 2rem;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.script-font {
    font-style: italic;
    color: var(--primary);
    font-weight: 400;
}

.subtitle {
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

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

.card h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

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

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(44, 62, 80, 0.05);
    border-radius: 50px;
    color: var(--dark);
}

/* Interactive Elements */
.btn-primary {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    background: var(--primary);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #FF5252;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: #888;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

.fade-in-down {
    animation: fadeInDown 1s ease-out;
}

.fade-in-up {
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.modal-header {
    position: relative;
    height: 300px;
}

.modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-header h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
}

.modal-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.modal-section h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
}

#modal-ingredients {
    list-style: none;
}

#modal-ingredients li {
    padding: 0.75rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

#modal-ingredients li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.75rem;
}

#modal-steps {
    padding-left: 1.5rem;
}

#modal-steps li {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .modal-header h2 {
        font-size: 1.8rem;
    }
}

/* Cooking Mode Slideshow */
.cooking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    color: white;
    transition: opacity 0.3s ease;
}

.cooking-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.slideshow-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slide-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.slide-caption {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.caption-text {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.5rem;
}

.caption-sub {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 300;
}

.slideshow-controls {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.close-cooking {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2001;
}

.step-indicator {
    color: #888;
    font-size: 0.9rem;
}

/* My Menu Sidebar & Toggle */
.menu-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--dark);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.login-fab {
    position: fixed;
    bottom: 12rem;
    /* 7rem + 60px + 1rem gap */
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    color: var(--dark);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s;
    text-decoration: none;
}

.login-fab:hover {
    transform: scale(1.1);
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.upload-fab {
    position: fixed;
    bottom: 7rem;
    /* 2rem + 60px + 1rem gap */
    right: 2rem;
    left: auto;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s;
    text-decoration: none;
}

.upload-fab:hover {
    transform: scale(1.1);
}

.upload-fab.hidden {
    display: none !important;
}

.ai-fab {
    position: fixed;
    bottom: 17rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a55eea, #dcd6f7);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s;
    text-decoration: none;
}

.ai-fab:hover {
    transform: scale(1.1);
}

.menu-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.menu-count.hidden {
    display: none;
}

.menu-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.menu-sidebar.hidden {
    transform: translateX(100%);
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--dark);
}

.close-sidebar {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
}

.menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.menu-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.menu-item-info {
    flex: 1;
}

.menu-item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.menu-item-info p {
    font-size: 0.75rem;
    color: #888;
}

.delete-btn {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: rgba(255, 0, 0, 0.2);
}

.empty-menu {
    text-align: center;
    margin-top: 3rem;
    font-style: italic;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
    min-width: 200px;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.toast.warning {
    background: linear-gradient(135deg, #FF9966, #FF5E62);
}

.toast.success {
    background: linear-gradient(135deg, #56ab2f, #a8e063);
}

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

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

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}