/* Base Styles and Custom Utilities */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --secondary-color: #10B981;
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent body scroll, handle inside containers */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-panel {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Interactions */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.1);
    color: #818CF8;
    border-right: 3px solid #6366F1;
}

.grid-card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Loading Spinner */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #6366F1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* SweetAlert2 Responsive Fixes */
.swal2-popup {
    padding: 1rem !important;
    border-radius: 20px !important;
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.swal2-html-container {
    margin: 1em 0 0 !important;
    overflow-x: hidden !important;
}

@media (max-width: 640px) {
    .swal2-popup {
        width: 98% !important;
        padding: 0.75rem !important;
    }

    .swal2-title {
        font-size: 1.25rem !important;
    }
}

/* Nice Scrollbar (used in Menu & Recipes + modals) */
.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 999px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.35);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) rgba(15, 23, 42, 0.35);
}

/* ===== Modern Micro-Effects (Safe) ===== */
.nav-item {
    transition: transform .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.nav-item:hover {
    transform: translateY(-1px);
}

/* Smooth details open/close feel (visual only) */
#sidebar details>div {
    animation: fadeIn .12s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Better scrollbars (optional but pro) */
#sidebar nav::-webkit-scrollbar,
#app-content::-webkit-scrollbar {
    width: 10px;
}

#sidebar nav::-webkit-scrollbar-thumb,
#app-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

#sidebar nav::-webkit-scrollbar-track,
#app-content::-webkit-scrollbar-track {
    background: transparent;
}