/* --- 1. CORE VARIABLES & RESET --- */
:root {
    --bg-main: #ffffff;
    --bg-alt: #f8f9fa;
    --text-main: #1a1a1a;
    --text-muted: #666;
    --accent-green: #D6E5D6;
    --danger: #e59c9c;
    --danger-hover:#dd6262;
    --border: #eeeeee;
    --shadow: 0 4px 12px rgba(0,0,0,0.02);
    --toolbar-height: 73px;
    --input-background: #fafafa;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    /* Fixes the "multiple scrollbars" issue */
    height: auto;
    overflow-x: hidden;
    overflow-y: auto; 
    background-color: var(--bg-main);
    font-family: system-ui, sans-serif;
    color: var(--text-main);
}

.img-standard {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 5px; flex: 1;  }
.nav-right { justify-content: flex-end; }

#status {
    color: #888;
    font-size: 0.8rem;
    margin-left: 15px;
}

/* --- 3. BUTTONS & CONTROLS --- */
.btn {
    display: inline-flex;       /* Helps with alignment */
    align-items: center;        /* Centers text/icons vertically */
    justify-content: center;
    font-family: inherit;       /* IMPORTANT: Prevents <button> from using system default font */
    font-size: 1rem;            /* Ensures font size is consistent */
    padding: 10px 20px;         /* Standardizes the footprint */
    text-decoration: none;      /* Removes underlines from <a> tags */

    color: black;
    height: 40px;
    border-radius: 25px;
    border: 1px solid #ddd;
    background-color: #f4f4f4;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.btn:hover {
    background-color:white;
}

.save-btn {
    background-color: var(--accent-green); /* A success green color */
    padding: 8px 16px;
    transition: background 0.2s;
    margin-left: 10px;
}

.save-btn:hover {
    background-color: #A1D18B;
}

.recipe-delete-btn {
    background-color: var(--danger); 
        padding: 8px 16px;
        transition: background 0.2s;
        margin-left: 10px;
}

.recipe-delete-btn:hover {
    background-color: var(--danger-hover);
}

.tool-btn[title="Clear formatting"]:hover {
    background-color: #f8d7da; /* Light red/pink tint */
    color: #721c24;
}

.formatting-controls {
    display: flex;
    gap: 5px;
    margin: 0 0px;
    justify-content: center;
}

.tool-btn {
    background: #333;
    color: white;
    border: 1px solid #444;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.tool-btn:hover { background: #555; }

/* ----- Search styles ----- /*
/* 1. SHARED BASE STYLE (The "Ring") */
#search-input,
.header-tag-select,
.filter-wrapper,
.heart-filter-label {
    height: 40px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: #f4f4f4;
    transition: all 0.3s ease;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* 2. SHARED HOVER & FOCUS STATE */
#search-input:hover, 
#search-input:focus,
.header-tag-select:hover,
.header-tag-select:focus,
.filter-wrapper:hover,
.heart-filter-label:hover {
    background-color: #ffffff;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 3. SEARCH SPECIFIC - COLLAPSED STATE */
#search-input {
    width: 40px; 
    padding: 0;
    color: transparent;
    font-size: 0.95rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px; /* Slightly adjusted for the circle */
    opacity: 0.8;
}

/* 4. SEARCH SPECIFIC - EXPANDED STATE */
#search-input:focus {
    padding: 0 15px 0 35px;
    background-position: 10px center;
    color: var(--text-main);
    cursor: text;
    opacity: 1;
}

/* ----- End of Search styles ----- /*

/* --- 4. RECIPE GRID (Gallery View) --- */
.recipe-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: calc(var(--toolbar-height) + 40px) 20px 40px;
    justify-content: center;
    max-width: 1300px;
    margin: 0 auto;
}

.recipe-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
    display: block;
    height: 100%;
    z-index: 1;
}

.recipe-card-link:hover { transform: scale(1.008); }

.recipe-card-link:active {
    transform: scale(0.98); /* Makes the card "press down" when tapped on a phone */
}

.recipe-card {
    width: 280px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
}

@media (max-width: 647px) {
    .recipe-card { width: 350px;}
    .nav-left h2 {font-weight: normal; font-size: 1.2em;}
    img.icon {height: 20px;}
    }

.recipe-info { padding: 15px; }
.recipe-info h3 { margin: 0 0 5px 0; font-size: 1.1rem; }

/* --- 5. RICH EDITOR LAYOUT --- */
.editor-main {
    max-width: 800px;
    margin: var(--toolbar-height) auto 0;
    padding: 40px 20px;
}

/* Thumbnail Section */
.thumbnail-section {
    margin-bottom: 40px;
    text-align: center;
}




/* --- 6. UTILITIES --- */
[contenteditable]:empty:before {
    content: attr(placeholder);
    color: #aaa;
}


/* Image Preview Styling */
#thumbnail-preview {
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: var(--bg-alt);
}

.rich-editor {
    font-size: 1.1rem;
    color: #333;
    white-space: pre-wrap; /* Keeps newlines */
    min-height: 300px;
    outline: none;
    line-height: 1.6;
}

.rich-editor div, .rich-editor p {
    margin-bottom: 10px;
    min-height: 1em;
}

/* Ensure the editor knows how to display these tags */
#editor-content h2 {
    font-size: 24px;
    margin: 15px 0 5px 0;
}

#editor-content h3 {
    font-size: 20px;
    margin: 12px 0 5px 0;
}

/* Fallback: if the text is stuck in a 'div' or 'p', 
   make sure there is space between lines */
#editor-content div, #editor-content p {
    margin-bottom: 5px;
}

#editor-content p {
    margin: 0 0 10px 0; /* Adds consistent spacing between lines */
    min-height: 1em;    /* Keeps empty lines from collapsing */
}


#editor-content div, #editor-content p {
    min-height: 1.2em; /* Prevents empty lines from collapsing */
}

/* The container for the images */
#image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px;
}

.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; 
    width: 100%; height: 100%; background: rgba(0,0,0,0.5);
    justify-content: center; align-items: center;
}
.modal-content {
    background: white; padding: 20px; border-radius: 8px; width: 400px; overflow-y: auto;
}

/* The actual images in the modal */
.modal-grid-img {
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    background: #eee; /* Shows gray while loading */
}

.modal-grid-img:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

/* Container for each image in the grid */
.img-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* The delete "X" button */
.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* Show button on hover */
.img-container:hover .delete-btn {
    display: flex;
}

.delete-btn:hover {
    background: red;
}

/* Highlight the active block slightly (optional but helpful) */
#editor-content h2:focus, #editor-content h3:focus {
    outline: none;
    background-color: rgba(0,0,0,0.02);
}

/* Prevent image resizing issues in the editor */
#editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

#editor-content, #title-input, #tags-input {
    background-color: var(--input-background);
    border: solid 1px lightgray;
}


/* If the editor is empty OR only contains a break */
.rich-editor:empty::before,
.rich-editor:has(> br:only-child)::before {
    content: attr(placeholder);
    color: #666;
    cursor: text;
}


/* Site header - Public recipies */
.main-header {
    text-align: center;
    width: 100%;
}

.main-header h1 {
    display: inline;
    font-size: 2rem;
    color: #333;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    font-weight: 300;
}

.toolbar button.active {
    background-color: #007bff; /* Bright blue */
    color: white;
    border-color: #0056b3;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.formatting-controls button.active {
    background-color: #007bff !important;
    color: white !important;
    border-color: #0056b3;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}


.title-full {
    display: block;
    margin: 0;
}

.tagline {
    display: inline;
}

@media (max-width: 1000px) {
    .title-full, .tagline { 
        display: none; 
    }
    
    .title-short::before {
        font-weight: bold;
        font-size: 1.5rem;
    }
    .title-short {
        display: block;
    }
}
    
    /* Optional: Ensure the header doesn't take up too much vertical space */
    .logo-container {
        display: flex;
        align-items: center;
    }
}

.recipe-intro {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Show exactly 3 lines */

    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;

    line-height: 1.5em; /* Adjust based on your font */
    max-height: 4.5em;  /* line-height * 3 */
}

.recipe-author {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    
}

/* Search */

/* End of search */


.header-search-form {
    display: flex;
    align-items: center;
}





/* Specifically for the dropdown */
.header-tag-select {
    flex: 1;
    cursor: pointer;
    appearance: none; /* Optional: cleaner look */
    text-align: center;
}
    
.search-btn {display: none;}

/* The main container - keeps everything stable */
.search-wrapper {
    align-items: center;
    padding: 5px;
    width: 320px; /* Fixed width to prevent layout jumping */
}

.header-tag-select {
    border: none;
    background: transparent;
    background-color: white;
    outline: none;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    border-left: 1px solid #ccc;
    padding-left: 10px;
    /* Prevent the dropdown from shrinking */
    flex-shrink: 0; 

        background-color: rgba(255, 255, 255, 0.6); /* Semi-transparent start */
    transition: all 0.3s ease; /* This creates the "fade" effect */
}

.tag-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.tag-link {
    padding: 6px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-size: 0.9em;
    transition: background 0.2s;
}

.tag-link:hover {
    background: #e0e0e0;
}

.tag-link.active {
    background: #007bff;
    color: white;
}


/* Centers the content and adds padding to the sides of the text */
.view-page .content-display {
    max-width: 900px;
    margin: 100px auto;
    padding: 0 20px; /* This creates the text margins */
    line-height: 1.6;
    color: #333;
}

.view-page .content-display .content {
max-width: 500px;
display: block;
margin-top: 50px;
 
}

/* Styles the recipe image */
.view-page .recipe-image-container {
    width: 100%;
    margin: 0 auto 0px auto;
}

.view-page .recipe-image-container img {
    border-radius: 5px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Heading #1 Title Input */
.h1-input {
    width: 100%;
    border: none;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    outline: none;
    letter-spacing: -1px;
}


/* Optional: style the title specifically in view mode */
.view-page .content-display h1 {
    margin-bottom: 20px;
    font-size: 2rem;
    text-align: center;
}

@media (min-width: 769px) {
.h1-input { font-size: 3rem;}
.view-page .content-display h1 {font-size: 2.5rem;}
}


/* A reusable container for centering content on the page */
.container-centered {
    max-width: 1000px;
    margin: 40px auto;
    padding: calc(var(--toolbar-height) + 10px) 20px 40px;
}

.settings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 20px; /* Space between grid and back button */
}

/* On large screens, keep the content from spreading too wide */
@media (min-width: 1200px) {
    .settings-grid {
        max-width: 1000px; /* Adjust this number to your liking */
    }
}

/* Selve baggrunden der dækker skærmen */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.7); /* Mørk gennemsigtig baggrund */
    backdrop-filter: blur(5px); /* Gør baggrunden sløret for fokus */
}

/* Den hvide boks i midten */
.modal-content {
    background-color: #fff;
    margin: 5% auto; 
    padding: 25px;
    border-radius: 12px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto; /* Tillader scroll hvis der er mange billeder */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Luk-knappen (X) */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.media-grid img {
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    border: 3px solid transparent;
}

.media-grid img:hover {
    transform: scale(1.05);
    border-color: #007bff; /* Blå kant når man holder musen over */
}

.btn-delete-overlay {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-delete-overlay:hover {
    background: #c82333;
}

/* Placer slette-krydset øverst til højre på hvert billede i galleriet */
.media-item .btn-delete-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0; /* Skjul indtil musen er over */
    transition: opacity 0.2s;
}

.media-item:hover .btn-delete-overlay {
    opacity: 1; /* Vis kryds ved hover */
}

.media-item:hover img {
    filter: brightness(0.8);
}

.media-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    align-items: start; /* Holder rækkerne stabile */
}

.media-item {
    transition: transform 0.2s;
    aspect-ratio: 3 / 2; /* Gør alle felter til forholdet 4:3 */
    background: #f0f0f0; /* Viser en grå boks mens billedet loader */
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.media-item img {
     cursor: pointer;
}

.modal-upload-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Gør det tydeligt at man kan klikke på billederne for at vælge dem */
.media-item img {
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.media-item img:hover {
    border-color: #007bff;
}

/* 1. Setup the toolbar as the grid container */
.toolbar {
    position: fixed;
    top: 0;
    left: 0; /* Ensures it starts at the very edge */
    width: 100%;
    height: var(--toolbar-height);
    background: whitesmoke;
    z-index: 1000;
    border-bottom: 1px solid #eee;
    justify-content: space-between; /* This pushes left and right apart */
    /* Layout Engine */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}


/* ------- Heart icons --------- */

/* Core Heart Icon Logic (Masking technique) */
.heart-icon {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    
    /* Using SVG as a mask to allow easy color changes via background-color */
    -webkit-mask: url('/assets/icons/heart.svg') no-repeat center / contain;
    mask: url('/assets/icons/heart.svg') no-repeat center / contain;

    pointer-events: none;
}

.recipe-card-container {
    position: relative; /* Anchor for the absolute button */
}

/* Specific positioning for the floating heart (removes background/border) */
.floating-heart {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: none;
    box-shadow: none;
}

/* 2. Show on hover of the card container */
.recipe-card-container:hover .floating-heart {
    opacity: 1;
    visibility: visible;
}

/* 3. PERMANENT VISIBILITY: Show if the heart is red */
/* This looks for an img tag whose src attribute contains the string 'heart_red' */
.floating-heart:has(img[src*="heart_red"]) {
    opacity: 1;
    visibility: visible;
}

.floating-heart:hover {
    opacity: 1;
    visibility: visible;
    transform: scale(1.05); /* Subtle pop effect */
}

@media (max-width: 768px) {
    .floating-heart {
        opacity: 1 !important;
        visibility: visible !important;
    }}

.heart-icon-img {
    width: 22px;
    height: 22px;
    pointer-events: none; 
}

/* -------- Navigation icons with text or tooltips, depending on screen size ------- */

/* DESKTOP: Text visible to the right of the icon */
.tooltip-container {
    display: flex;
    align-items: center;
}

.tooltip-text {
    display: inline-block;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 8px; /* Space between icon and text */
}

@media (min-width: 768px) {
.categories-filter .tooltip-text {display: none;}
}

/* MOBILE/TABLET: Text becomes a floating tooltip */

@media (max-width: 768px) {

    .btn:not(.btn-keep-style) {
        width: 40px; 
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* This is the anchor for the tooltip */
    .tooltip-container {
        position: relative; 
        display: inline-flex; /* Changed from flex to hug the button */
        justify-content: center;
        margin-left: 0;
    }

    .tooltip-text {
        --base-delay: 1s;
        --stagger-delay: 1s; /* 1s delay between items */
        
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        
        width: max-content;
        white-space: nowrap;
        background-color: #333;
        color: #fff;
        padding: 6px 12px;
        border-radius: 4px;
        z-index: 1001;
        margin-left: 0px;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        /* Total animation time is 4s, but visibility window is narrowed */
        animation: autoShowTooltip 4s ease-in-out forwards;
        animation-delay: calc(var(--base-delay) + (var(--i) * var(--stagger-delay)));
    }

    /* Arrow pinned to the TOP of the tooltip, centered under the icon */
    .tooltip-text::after {
        content: "";
        position: absolute;
        bottom: 100%; /* Bottom of arrow at top of box */
        left: 50%;
        transform: translateX(-50%);
        border-width: 6px;
        border-style: solid;
        border-color: transparent transparent #333 transparent;
    }

    @keyframes autoShowTooltip {
        0% { 
            opacity: 0; 
            visibility: visible; 
            transform: translateX(-50%) translateY(15px); 
        }
        /* Appears quickly (at 0.2s of its own 4s timeline) */
        5% { 
            opacity: 1; 
            transform: translateX(-50%) translateY(10px); 
        }
        /* Disappears at 25% (which is 1s into the 4s duration) */
        /* This matches your 1s stagger delay perfectly */
        25% { 
            opacity: 1; 
            transform: translateX(-50%) translateY(10px); 
        }
        30%, 100% { 
            opacity: 0; 
            transform: translateX(-50%) translateY(0px); 
            visibility: hidden; 
        }
    }

}

/* ------end og nav icons------- */

site_footer {
            display: flex;
    flex-direction: column;
    align-items: center;
}

site_footer section {
    max-width: 800px;
    margin-left: 40px;
    margin-right: 40px;

    text-align: center;
}

.icon {  height: 25px;
         transition: filter 0.3s ease, transform 0.3s ease;
         display: inline-block; 
}

.icon:hover {
    transform: scale(1.05);
}

/* Prevent the parent card link from showing a "click" state when clicking the heart */
.recipe-card-link:active .recipe-card {
    transform: none; /* If you have a shrink effect on click, this disables it */
}

/* --------- Consolidated Responsive Header Actions ------------ */

/* 1. SHARED ACTION WRAPPER (The Flex Row) */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    transition: all 0.3s ease;
}





/* --- CATEGORY FILTER SPECIFIC --- */
.filter-wrapper {
    position: relative;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.filter-icon {
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 2;
}

.header-tag-select {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0; /* Invisible dropdown over the icon */
    cursor: pointer;
    z-index: 3;
}

/* --- HEART FILTER SPECIFIC --- */
.heart-filter-label {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0; /* Clear previous margins */
}

.heart-icon-filter {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

/* 4. DESKTOP ADAPTIONS (769px and up) */
@media (min-width: 769px) {
    #search-input {
        width: 200px; /* Always expanded on desktop */
        padding: 0 10px 0 35px;
        background-position: 10px center;
        color: var(--text-main);
    }

    .filter-wrapper {
        width: auto;
        padding-left: 10px;
        border-radius: 0;
        background: transparent;
        border: none;
    }

    .filter-wrapper:hover { box-shadow: none; background: transparent; }

    .header-tag-select {
        position: static;
        opacity: 1;
        width: auto;
        padding-left: 25px;
        background: transparent;
        appearance: auto;
    }

}

@media (max-width: 769px) {

 #search-input:not(:focus) {
        color: transparent !important;
        text-indent: -9999px; /* Pushes the text far off-screen */
    }

    /* Hide the placeholder text ("Søg i opskrifter...") */
    #search-input:not(:focus)::placeholder {
        color: transparent;
    }
}

/* --- CATEGORY FILTER (Funnel Inside) --- */
.filter-wrapper {
    position: relative; /* Essential for absolute positioning of children */
    display: flex;
    align-items: center;
    height: 40px;
    flex-shrink: 0;
}

.filter-icon {
    height: 30px;
    pointer-events: none; /* Allows clicks to pass through to the select */
    z-index: 10;         /* Keeps icon visible on top of background */
}

.header-tag-select {
    width: 100%;
    height: 40px;
    /* 35px padding-left creates the space for the icon inside the box */
    padding: 8px 12px 8px 35px; 
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: #f4f4f4;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none; /* Removes default browser arrow */
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

/* Hover/Focus state */
.header-tag-select:hover,
.header-tag-select:focus {
    background-color: #ffffff;
    border-color: #ccc;
    outline: none;
}

/* Ensure Desktop view doesn't break the positioning */
@media (min-width: 769px) {
    .filter-wrapper {
        width: auto; /* Let it grow with the text width */
    }
    
    .header-tag-select {
        width: 180px; /* Or whatever width you prefer for desktop */
        position: relative; /* Keep it relative so icon stays inside */
        opacity: 1;
    }
    .filter-icon {
        position: absolute;
        transform: translateX(-62px);

    }
}

/* public_grid - load more recipies */
#loading-trigger {
    width: 100%;
    height: 50px;       /* Give it physical height */
    margin-top: 20px;
    margin-bottom: 50px; /* Ensure there is space below the last recipes */
    display: block;      /* Ensure it's not inline */
    clear: both;         /* If you are using floats in your grid */
}

/* Reduces text opacity for draft recipes */
.recipe-card.is-draft .recipe-info {
    opacity: 0.6;
}

/* Optional: Add a 'Draft' label or grayscale the image to make it clearer */
.recipe-card.is-draft .recipe-thumbnail img {
    filter: grayscale(40%);
}

/* --- MOBILE SEARCH BUBBLE --- */
/* DESKTOP: Hide mobile-specific elements */
.mobile-search-trigger, .mobile-search-bubble {
    display: none;
}

@media (max-width: 769px) {
    /* 1. Hide the standard desktop input */
    #search-input {
        display: none !important;
    }

    /* 2. Show and style the mobile icon trigger */
    .mobile-search-trigger {
        display: flex;
        width: 40px;
        height: 40px;
        background-color: #f4f4f4;
        border: 1px solid #ddd;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    /* 3. The Bubble Container (Hidden by default) */
    .mobile-search-bubble {
        display: none; /* Controlled by JS class */
        position: absolute;
        top: 55px;
        left: 0;
        z-index: 2000;
    }

    .search-wrapper.mobile-open .mobile-search-bubble {
        display: block;
    }

    /* 4. The actual input field inside the bubble */
    #mobile-search-input {
        width: 230px;
        height: 48px;
        background-color: white;
        border: 2px solid var(--accent-green);
        border-radius: 12px;
        padding: 0 15px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        font-size: 1rem;
    }
}
/* --- end of MOBILE SEARCH BUBBLE --- */

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Ensure the text doesn't hide behind the icon */
#search-input, #mobile-search-input {
    padding-right: 40px !important; 

}

/* Position the icon on top of the input */
.search-action-icon {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 5;
    transition: transform 0.1s ease;
}

.search-action-icon:active {
    transform: scale(0.9);
}

/* Hide desktop bar on mobile so we only use the trigger button */
@media (max-width: 768px) {
    .desktop-only {display: none !important;}
    .desktop-only {display: none;}
    .mobile-search-trigger {display: flex;}
}

/* Ensure the form elements flow horizontally */
.filter-form {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between search, filter, and heart */
    flex-wrap: nowrap; /* Prevent them from wrapping to a new line on desktop */
}


/* Desktop: Hide the mobile trigger, show the input bar */
@media (min-width: 769px) {
    .mobile-search-trigger {
        display: none;
    }
    .desktop-only {
        display: flex;
    }
}

/* links on edit page */
/* Styling for the links inside the rich editor */
.rich-editor a.recipe-internal-link {
    color: #2a7ae2;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
}

/* Optional: a subtle hover effect inside the editor */
.rich-editor a.recipe-internal-link:hover {
    color: #1c54a1;
    background-color: #f0f7ff;
}
/* end of links on edit page */

/* -------Draft checkbox styling---------- */

/* 1. Hide the checkbox visually but keep it accessible */
.draft.btn input[type="checkbox"] {
  position: absolute;
  height: 0;
  width: 0;
}

/* 3. Change background when the internal checkbox is checked */
.draft.btn:has(input:checked) {
  background-color: #d6e5d6; /* Checked color (e.g., Green) */
  color: white;
  border-color: #388E3C;
}



