:root {
    --primary: #ff6b6b;
    --primary-dark: #ee5253;
    --secondary: #48dbfb;
    --accent: #feca57;
    --bg-dark: #0f172a;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-white: #f8fafc;
    --text-dim: #94a3b8;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(10, 15, 35, 0.82), rgba(10, 15, 35, 0.88)), url('assets/ai_chef_background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    transition: all 10s ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: move 20s infinite alternate;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation: move 25s infinite alternate-reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 40%;
    left: 40%;
    animation: move 30s infinite alternate;
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 100px) scale(1.1);
    }
}

/* Container & Layout */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.btn-icon {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    border-color: var(--primary);
}

header,
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    color: var(--primary);
    width: 48px;
    height: 48px;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--primary);
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Sections */
.input-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

h2 {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    h2.cooking-header {
        flex-direction: column;
    }
}

.input-section h2 {
    justify-content: space-between;
    width: 100%;
}

h2 i {
    color: var(--primary);
}

/* Inputs & Buttons */
.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
.pro-feature-input,
select {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
.pro-feature-input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

select option {
    background: white;
    color: #333;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary.cooking-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(72, 219, 251, 0.1);
    transform: translateY(-2px);
}

.btn-secondary.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-top: 1rem;
}

#exit-cooking {
    margin-right: 20px;
    margin-top: 0px;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 107, 107, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: auto;
    position: absolute;
    top: 1.7rem;
    right: 1.8rem;
}

@media (max-width: 600px) {
    #exit-cooking {
        margin-right: 0px;
        position: relative;
        top: 0;
        right: 0;
    }
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn-generate {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), #ff9f43);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 1.2rem;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-secondary.large {
    flex: 1;
    padding: 1.2rem;
    font-size: 1.1rem;
    border-width: 2px;
}

.btn-generate:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

/* Quick Toggles */
.quick-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

/* Pro Feature Indicators */
.pro-feature {
    position: relative;
    border-color: rgba(254, 202, 87, 0.3) !important;
}

.pro-feature::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;
    left: -1px;
    border-radius: inherit;
    border: 1px solid rgba(254, 202, 87, 0.2);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(254, 202, 87, 0.05);
}

/* Hide locks for premium users */
body.is-premium .pro-lock-icon,
body.is-premium .pro-feature i[data-lucide="lock"],
body.is-premium .pro-feature .lucide-lock {
    display: none !important;
}

body.is-premium .pro-feature {
    border-color: var(--glass-border) !important;
}

body.is-premium #scan-fridge {
    border-color: var(--secondary) !important;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    min-height: 40px;
}

.tag {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid var(--primary);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: scaleIn 0.3s ease;
}

.tag span {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.tag span:hover {
    opacity: 1;
}

/* Preferences */
.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.pref-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pref-box label {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.pref-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.radio-label {
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.radio-label:has(input:checked) {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

.radio-label input[type="radio"]:checked+div div:first-child {
    color: var(--primary);
}

/* Recipes Grid */
/* === PREMIUM RECIPE CARDS (Glassmorphism) === */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.recipe-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
}

.recipe-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.recipe-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease;
    position: relative;
}

.recipe-card:hover .recipe-card-image {
    transform: scale(1.05);
}

.recipe-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recipe-card-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.recipe-card-meta i {
    margin-right: 4px;
    color: var(--accent-light);
}

.favorite-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.recipe-card-type {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    font-weight: 600;
}

/* === STOCK PHOTO INDICATOR === */
.stock-photo-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
    cursor: help;
}

.stock-info-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stock-photo-indicator:hover .stock-info-icon,
.stock-photo-indicator.active .stock-info-icon {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
}

/* Hide on small history/favorite cards */
.recipes-grid-mini .stock-photo-indicator,
.history-grid-mini .stock-photo-indicator {
    display: none !important;
}

.stock-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(20, 20, 25, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.72rem;
    width: 180px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 11;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .stock-tooltip {
        width: 150px;
        font-size: 0.65rem;
    }
}

.stock-photo-indicator:hover .stock-tooltip,
.stock-photo-indicator.active .stock-tooltip {
    opacity: 0.8;
    transform: translateY(0);
}

/* === MODAL & UI POLISH === */
.saved-recipes-modal-content {
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .recipes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .recipe-card-image {
        height: 120px;
    }

    .recipe-card-content {
        padding: 10px;
    }

    .recipe-card-content h3 {
        font-size: 0.95rem;
    }

    .saved-recipes-modal-content {
        padding: 16px;
        border-radius: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }
}

.recipe-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.recipe-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: black;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Shopping List */
.shopping-section {
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.shopping-list {
    list-style: none;
    margin-top: 1rem;
}

.shopping-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.remove-item {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.remove-item:hover {
    opacity: 1;
}

.ing-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#confirm-modal,
#email-invite-modal {
    z-index: 2000;
}

.modal-content {
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.modal-content.wide {
    max-width: 1200px;
}

.modal-content.small {
    max-width: 420px;
}

@media (max-width: 600px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .close-modal,
    .close-settings,
    .close-pro,
    .close-auth {
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

.close-modal,
.close-settings,
.close-pro {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Helper Classes */
.hidden {
    display: none !important;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--glass);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
}

.loader.spin,
.lucide.lucide-loader-2.spin {
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.shopping-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cooking-mode-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: stretch;
}

.cooking-sidebar {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 55vh;
}

.cooking-sidebar h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.cooking-sidebar ul li {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.cooking-sidebar ul li:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(254, 202, 87, 0.2);
    transform: translateX(4px);
}

.cooking-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.cooking-instruction {
    font-size: 1.8rem;
    line-height: 1.6;
    font-weight: 300;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Toast and Success View */
#auth-toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--primary);
    padding: 1.2rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 107, 107, 0.2);
    text-align: center;
}

.auth-success-view {
    text-align: center;
    padding: 2.5rem 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(85, 239, 196, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #55efc4;
    border: 2px solid #55efc4;
}

.auth-success-view h2 {
    color: #55efc4;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.auth-success-view p {
    color: var(--text-white);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-success-view .activation-notice {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: left;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.2rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .recipe-meta-badges {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .recipe-header-flex {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start !important;
    }

    .recipe-content-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .cooking-mode-layout {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 1.5rem !important;
    }

    .cooking-sidebar {
        max-height: 200px;
        order: 2;
    }

    .cooking-main {
        order: 1;
    }

    .cooking-instruction {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
    }

    .cooking-mode-nav {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .cooking-mode-nav button {
        width: 100%;
    }

    .preferences-grid {
        grid-template-columns: 1fr !important;
    }

    .kifli-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .inventory-add-grid {
        grid-template-columns: 1fr !important;
        background: rgba(0, 0, 0, 0.4) !important;
    }

    /* Kisebb gombok mobilon */
    .btn-icon {
        width: 40px !important;
        height: 40px !important;
    }

    /* Recept kártyák finomítása */
    .recipes-grid {
        grid-template-columns: 1fr !important;
        padding: 0 0.5rem;
    }
}

/* Premium Modal Animations */
.modal:not(.hidden) .modal-content {
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Tooltip Enhancement (Basic Browser Tooltip) */
[title] {
    cursor: help;
}

/* Family Member List Item Hover */
#family-members-list>div {
    transition: all 0.2s ease;
}

#family-members-list>div:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateX(4px);
}

/* Enhanced Family Section */
.family-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid var(--glass-border);
}

.family-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.family-member-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.auth-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
    margin: 1.5rem 0;
}

.feature-item {
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06) !important;
}

@media (max-width: 768px) {
    .header-top {
        justify-content: center;
        margin-bottom: 1.5rem;
        order: 2;
    }

    .logo {
        order: 1;
        margin-bottom: 1rem;
    }

    .logo h1 {
        font-size: 2.2rem;
    }

    #show-saved-btn span {
        display: none;
    }

    #show-saved-btn {
        width: auto !important;
        padding: 0.8rem !important;
    }

    .header-status {
        display: none !important;
    }
}

.invite-box,
.join-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Admin Dashboard Tooltip Hover */
.admin-tooltip-container:hover .admin-users-tooltip {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#random-recipe {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-date-header {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    padding: 0.8rem 0;
    margin-top: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-date-header:first-child {
    margin-top: 0;
}

.history-date-header i {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.inv-edit-expiry {
    max-width: 150px;
}