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

:root {
    --primary-color: #006AA7;
    --secondary-color: #FECC02;
    --dark-color: #1D3C5C;
    --light-color: #eeeeee /* more paper-like off-white */
    --text-color: #3E3A39;
    --accent-color: #EDE6DB; /* subtle parchment accent */
    --paper-texture: url('../images/Paper-Texture.jpg');
    --shadow-soft: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.logo img {
    height: 40px;
    margin-right: 8px;
    transition: opacity 0.3s ease;
}

.logo h1,
.user-menu span {
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* Base Styles - Keep the same clean aesthetic but with Swedish colors */
body {
    font-family: 'Homemade Apple', cursive;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: var(--paper-texture);
    background-repeat: repeat;
}

  @media (max-width: 600px) {
    body { font-family: Georgia, serif; }
  }

body.no-scroll {
    overflow: hidden;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu li {
    margin-left: 20px;
    align-items: center;
    position: relative;
}

.nav-menu a {
    font-family: 'Shadows Into Light', cursive;
    letter-spacing: 0.5px;
    color: white;
    font-weight: 500;
    padding: 8px 12px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition), opacity 0.3s ease;
    font-size: 1rem;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--secondary-color);
}

.nav-menu a.active::after, .nav-menu a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
}

h1, h4, .logo h1, nav a, .recipe-card h3, .favorites-header h1 {
    font-family: 'Shadows Into Light', cursive;
    color: var(--dark-color);
  }

  /* User dropdown menu styles */
.user-menu {
    position: relative;
}

.user-menu > a {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.user-menu > a:hover,
.user-menu > a:focus {
    color: var(--secondary-color);
}

.user-menu > a:hover::after,
.user-menu > a:focus::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background-color: var(--secondary-color);
}

.user-menu img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.user-menu span {
    font-weight: 400;
    font-size: 1rem;
    color: white;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
    text-align: left;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    width: 100%;
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 12px 16px;
    display: block;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}

.dropdown-menu a:hover {
    background-color: #f8f8f8;
    color: var(--primary-color);
}

.dropdown-menu a i {
    width: 20px;
    text-align: center;
}

/* Add smooth underline animation */
.nav-menu a::after,
.logo a::after,
.user-menu > a::after,
.dropdown-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Expand underline on hover */
.nav-menu a:hover::after,
.nav-menu a.active::after,
.logo a:hover::after,
.user-menu > a:hover::after,
.user-menu > a:focus::after,
.dropdown-menu a:hover::after {
    width: 100%;
}

/* Ensure color changes smoothly */
.nav-menu a:hover,
.nav-menu a.active,
.logo a:hover,
.user-menu > a:hover,
.user-menu > a:focus,
.dropdown-menu a:hover {
    color: var(--secondary-color);
}

/* Special style for logout item */
.dropdown-menu a.logout-link:hover {
    color: red;
}

.dropdown-menu a.logout-link:hover::after {
    background-color: red;
}

/* Specific overrides */
.dropdown-menu a {
    position: relative;
    transition: var(--transition);
}

/* Fix logout separately */
.dropdown-menu a.logout-link {
    color: var(--text-color);
}

/* Make sure text inside links also inherits the hover color */
.logo a:hover img,
.logo a:focus img {
    content: url('images/dala-horse-yellow.webp');
}

.logo a:hover h1,
.logo a:focus h1,
.user-menu > a:hover span,
.user-menu > a:focus span {
    color: var(--secondary-color);
}

/* Links appear handwritten */
a {
    font-family: 'Homemade Apple', cursive;
    color: var(--dark-color);
    text-decoration: underline dashed var(--dark-color);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.btn, .btn-small {
    font-family: 'Homemade Apple', cursive;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    border-radius: 20px;
    box-shadow: 0 2px 6px var(--shadow-soft);
    transition: var(--transition);
}

.btn:hover, .btn-small:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

section {
    padding: 60px 0;
}

/* Section headings underline accent */
section h2 {
    position: relative;
    display: inline-block;
}
section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 50%;
    height: 3px;
    background-color: var(--secondary-color);
}

/* Add Dalecarlian pattern to section dividers */
section:not(:last-child)::after {
    content: '';
    display: block;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='10' viewBox='0 0 40 10'%3E%3Cpath d='M0,5 L5,0 L10,5 L15,0 L20,5 L25,0 L30,5 L35,0 L40,5 L35,10 L30,5 L25,10 L20,5 L15,10 L10,5 L5,10 Z' fill='%23FECC02'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    margin: 60px auto 0;
    width: 80%;
    max-width: 800px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.logo h1 {
    font-size: 1.8rem;
    color: white;
    font-weight: 500;
}

.logo a {
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 8px 12px;
}

.logo a:hover,
.logo a:focus {
    color: var(--secondary-color);
}

.logo a:hover::after,
.logo a:focus::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background-color: var(--secondary-color);
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background-color: rgba(255, 255, 255, 0.1);
        margin-top: 10px;
    }
    
    .dropdown-menu a {
        color: var(--text-color); /* Change from white to dark grey */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: var(--secondary-color);
    }

    .dropdown-menu a.logout-link:hover {
        color: red;
    }
    
    .user-menu:hover .dropdown-menu {
        display: none; /* Don't show on hover for mobile */
    }
    
    .dropdown-menu.show {
        display: block; /* Show when toggled via JavaScript */
    }
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.menu-toggle i {
    transition: transform 0.3s ease, color 0.3s ease;
  }
  
  .menu-toggle.active i {
    transform: rotate(90deg); /* Rotates to make it feel like an X */
    color: var(--secondary-color);
  }  

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/swedish-kitchen.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 0;
}

/* Hero section with Swedish-inspired overlay */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M0,0 L40,0 L40,40 L0,40 Z' fill='none' stroke='%23FECC02' stroke-width='1' stroke-opacity='0.2'/%3E%3C/svg%3E");
    opacity: 0.1;
    z-index: -1;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

/* Input fields and forms on recipe page */
input, textarea {
    font-family: 'Homemade Apple', cursive;
    border: 1px solid var(--secondary-color);
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.9);
}

.search-bar button {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    border: none;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background-color: #E5B800;
}

/* Featured Recipes Section */
.featured-recipes h2, .categories h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

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

.recipe-card {
    background-color: rgba(255, 255, 255, 0.95);
    background-image: var(--paper-texture);
    background-size: cover;
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow-soft);
}

.recipe-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.recipe-image {
    height: 200px;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.05);
}

.recipe-content {
    padding: 20px;
}

.recipe-content h3 {
    font-family: 'Shadows Into Light', cursive;
    font-size: 1.5rem;
    margin-bottom: 0.4em;
}

.recipe-meta {
    display: flex;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.recipe-meta span {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.recipe-meta i {
    margin-right: 5px;
}

.recipe-description {
    margin-bottom: 15px;
    color: #666;
}

/* Categories Section */
.categories {
    background-color: var(--accent-color);
}

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

.category-item {
    background-color: white;
    border-radius: 4px;
    border: 1px solid #E0E0E0;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.category-item i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Footer Styles */
footer {
    background-color: var(--accent-color);
    background-image: var(--paper-texture);
    background-size: cover;
    color: var(--dark-color);
    padding: 40px 0;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-color) 40%, var(--secondary-color) 40%, var(--secondary-color) 60%, var(--primary-color) 60%, var(--primary-color) 100%);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #ddd;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
}

.social-icons a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Recipe Detail Page */
.recipe-detail {
    padding-top: 40px;
    background-color: var(--light-color);
}

.recipe-header {
    text-align: center;
    margin-bottom: 30px;
}

.recipe-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.recipe-header:before {
    content: '';
    display: block;
    width: 60px;
    height: 60px;
    background-image: url('../images/dala-horse.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0 auto 20px;
}

.recipe-image-large {
    border: 8px solid white;
    box-shadow: var(--box-shadow);
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    height: 400px;
}

.recipe-image-large:before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    z-index: -1;
}

.recipe-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.serving-adjuster {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #E0E0E0;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: white;
}

.serving-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.serving-controls button {
    background-color: var(--accent-color);
}

.serving-controls span {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.recipe-buttons {
    display: flex;
    gap: 10px;
}

.recipe-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
    background-color: white;
    border-radius: 4px;
    padding: 30px;
    box-shadow: none;
    border: none;
}

.recipe-content-wrapper::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    right: 20px;
    height: 5px;
    background-color: var(--secondary-color);
    border-radius: 5px;
}

.ingredients-section h2, .instructions-section h2, .recipe-tips h2, .nutrition-info h2, .related-recipes h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--dark-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
    display: inline-block;
}

.ingredients-section ul li {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
}

.ingredients-section ul li:last-child {
    border-bottom: none;
}

.quantity {
    font-weight: bold;
    margin-right: 5px;
}

.instructions-section ol {
    padding-left: 20px;
}

.instructions-section ol li {
    padding: 15px;
    background-color: var(--light-color);
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
}

#servings.animate {
    transition: transform 0.3s ease;
    transform: scale(1.3);
  }  

.instructions-section ol li strong {
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(0,106,167,0.05);
    padding: 0 3px;
    border-radius: 3px;
  }  

.nutrition-info {
    margin-bottom: 40px;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    text-align: center;
}

.nutrition-item {
    background-color: var(--accent-color);
    border-radius: 4px;
    padding: 15px;
}

.nutrition-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.recipe-tips {
    margin-bottom: 40px;
}

.recipe-tips ul {
    list-style: disc;
    padding-left: 20px;
}

.recipe-tips ul li {
    margin-bottom: 10px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .recipe-content-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        color: white;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        background-color: var(--primary-color);
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        align-items: center;
        padding-top: 30px;
        transition: var(--transition);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 15px 0;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .recipe-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .recipe-meta {
        flex-wrap: wrap;
    }

    .recipe-meta span {
        margin-bottom: 5px;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .recipe-header h1 {
        font-size: 2rem;
    }

    .recipe-image-large {
        height: 250px;
    }
}

/* Add this to your existing CSS file */

.category-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,106,167,0.9) 0%, rgba(0,106,167,0.9) 40%, rgba(254,204,2,0.9) 40%, rgba(254,204,2,0.9) 60%, rgba(0,106,167,0.9) 60%, rgba(0,106,167,0.9) 100%);
    opacity: 0.1;
    z-index: -1;
}

.category-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.recipes-list {
    padding: 60px 0;
}

.recipe-source {
    margin-top: 20px;
    font-size: 0.95rem;
    color: #666;
}

.recipe-source a {
    color: #006AA7; /* Swedish blue */
    text-decoration: underline;
}

.recipe-source a:hover {
    color: #FECC02; /* Swedish yellow */
}

.badge-farmor {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
    background-color: #FECC02; /* Swedish yellow */
    color: #1D3C5C; /* deep blue */
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recipe-origin-type {
    font-size: 0.95rem;
    color: #777;
    margin-top: 5px;
}
.recipe-origin-type i {
    margin-right: 5px;
    color: #999;
}

.farmor-bg {
    background: linear-gradient(to right, #fff8dc, #fff3b0);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(254, 204, 2, 0.15);
    margin-bottom: 20px;
}

.farmor-bg h1 {
    margin-bottom: 8px;
    font-size: 2.2rem;
}

.farmor-bg .badge-farmor {
    background-color: #f3c64c;
    color: #1D3C5C;
    font-size: 0.85rem;
    margin-left: 12px;
}

.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    z-index: 10;
    text-transform: uppercase;
}

.view-all-recipes {
    margin-top: 30px;
    text-align: center;
}

.view-all-recipes .btn {
    padding: 12px 24px;
    font-size: 1.1rem;
}


/* Fade-out and slide-up animation */
@keyframes fadeSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.fade-out {
    animation: fadeSlideUp 0.4s forwards;
}
  
  @keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
  }  

  

  .toast {
    font-family: 'Homemade Apple', cursive;
    visibility: hidden;
    min-width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 10px;
    padding: 10px 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 50px;
    transform: translateX(-50%);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease, bottom 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px; /* fixed height for centering */
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 30px;
}

#tags-container {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
    text-transform: capitalize;
    transition: background-color 0.3s;
}

.tag:hover {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}

/* Recipe Tags */
.recipe-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recipe-tags .tag {
    background-color: var(--secondary-color);
    color: var(--dark-color);
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: background-color 0.3s;
}

.recipe-tags .tag:hover {
    background-color: #e5b800;
}

.tag.vegetarian {
    background-color: #4CAF50; /* green */
}

.tag.vegan {
    background-color: #8BC34A; /* lighter green */
}

.tag.gluten-free {
    background-color: #FF9800; /* orange */
}

.tag.dairy-free {
    background-color: #03A9F4; /* light blue */
}

.tag.from-gramma {
    background-color: #e91e63; /* pink! */
}

.back-to-all {
    margin-bottom: 30px;
    text-align: center;
}

.back-to-all .btn {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: var(--accent-color);
    color: var(--dark-color);
    border-radius: 20px;
    transition: var(--transition);
}

.back-to-all .btn:hover {
    background-color: var(--secondary-color);
    color: var(--dark-color);
}

.category-heading {
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.category-heading::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 5px;
}

.nutrition-warnings h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.nutrition-warnings-table td {
    background-color: #fff;
}

.conflict-warning {
    margin-left: 8px;
    font-size: 1.2rem;
    color: #ff9800;
    vertical-align: middle;
}
.conflict-tag {
    display: inline-block;
    background-color: red;
    color: white;
    padding: 4px 8px;
    margin: 5px 5px 0 0;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.nutrition-warnings {
    margin-top: 2rem;
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.nutrition-warnings-table {
    width: 90%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.95rem;
}

.nutrition-warnings-table th,
.nutrition-warnings-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.nutrition-warnings-table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.nutrition-warnings-table td.yes {
    color: #2c8f2c;
    font-weight: bold;
}

.nutrition-warnings-table td.no {
    color: #b70000;
    font-weight: bold;
}

.collapsible {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.collapsible.closed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.nutrition-warnings-toggle {
    margin: 20px 0 10px;
    background: #eee;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

#nutrition-warnings-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.conflict-row {
    background-color: #ffeaea;
}
.ok-row {
    background-color: #f5fff5;
}

@media (max-width: 768px) {
    .recipe-grid, .nutrition-grid, .category-grid {
        grid-template-columns: 1fr;
    }
    .recipe-content-wrapper {
        flex-direction: column;
    }
    .ingredients-section, .instructions-section {
        width: 100%;
        margin-bottom: 20px;
    }
    .serving-controls button {
        font-size: 1.2rem;
        padding: 6px 12px;
    }
    .serving-adjuster, .recipe-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    .recipe-header h1 {
        font-size: 1.8rem;
    }
}

#clear-filters {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#clear-filters.visible {
    opacity: 1;
    visibility: visible;
}

.hidden {
    display: none;
}

.nutrition-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chevron-icon.rotate {
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.chevron-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

@media (max-width: 600px) {
    .nutrition-warnings-table thead {
        display: none;
    }

    .nutrition-warnings-table, 
    .nutrition-warnings-table tbody, 
    .nutrition-warnings-table tr, 
    .nutrition-warnings-table td {
        display: block;
        width: 100%;
    }

    .nutrition-warnings-table tr {
        margin-bottom: 1rem;
        background: white;
        box-shadow: var(--box-shadow);
        border-radius: 6px;
        padding: 10px;
    }

    .nutrition-warnings-table td {
        padding: 8px 12px;
        border-bottom: none;
        text-align: left;
        font-size: 0.95rem;
    }

    .nutrition-warnings-table td:before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
        color: var(--primary-color);
    }
}

.mobile-only {
    display: none;
  }
  
  @media (max-width: 768px) {
    .mobile-only {
      display: block;
    }
  
    .dropdown-menu {
      display: none !important;
    }
  }

  .btn-small.danger {
    background-color: #d9534f;
    color: white;
}
.btn-small.danger:hover {
    background-color: #c9302c;
}

.nav-menu a[href*="import"] {
    font-weight: bold;
  }  
  
  /* 🌙 Dark Mode */
body.dark {
    background-color: #2e3440;
    color: #d8dee9;
}

body.dark input,
body.dark textarea {
    background-color: #3b4252;
    color: #eceff4;
    border: 1px solid #4c566a;
}

/* Toggle Switch Style */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-top: 10px;
}
.toggle-switch input {
    display: none;
}
.toggle-switch .slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-switch .slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .slider {
    background-color: #88c0d0;
}
.toggle-switch input:checked + .slider::before {
    transform: translateX(26px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center; align-items: center;
  }
  .modal.show { display: flex; }
  
  .modal-content {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    font-family: 'Caveat', cursive;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
  }
  
  .modal-actions button {
    margin: 10px;
  }
  
  .dark-mode {
    --bg-color: #2E3440;
    --text-color: #ECEFF4;
    background: #2E3440;
    color: #ECEFF4;
  }
  
  .dark-mode .modal-content {
    background: #3B4252;
    color: #ECEFF4;
  }  

  .quantity {
    font-weight: bold;
    margin-right: 5px;
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
  }
  
  .quantity.animate {
    transform: scale(1.4);
    color: var(--primary-color);
  }
  
  .scroll-up-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    border: none;
    border-radius: 50%;
    padding: 14px 18px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
  }
  
  .scroll-up-btn.show {
    opacity: 1;
    visibility: visible;
  }

  /* —— FAVORITE BUTTON (OVERRIDES) —— */
.favorite-btn {
    /* ensure it sits on top of everything */
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.8);
    box-shadow: 0 2px 4px var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 5;
  }
  
  /* The icon is now Swedish-blue by default */
  .favorite-btn i {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
  }
  
  /* On hover: a solid blue circle + white heart */
  .favorite-btn:hover {
    background-color: var(--primary-color);
    transform: scale(1.1);
  }
  .favorite-btn:hover i {
    color: #fff;
  }
  
  /* When it’s “active” (already favorited): keep it blue */
  .favorite-btn.active i {
    color: var(--primary-color);
  }  

  /* in your style.css (or profile.css) */
/* make remove button float on top of the image */
.remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
  }
  
  /* placeholder for removed card + undo */
.undo-placeholder {
    grid-column: span 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .undo-notice {
    background: white;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--box-shadow);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-family: inherit;
  }
  
  .undo-notice .undo-btn {
    margin-top: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  /* Footer link colors */
footer a {
    color: var(--primary-color) !important;
    transition: color var(--transition);
  }
  
  footer a:hover,
  footer a:focus {
    color: var(--secondary-color) !important;
  }
  