body {
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    background: radial-gradient(ellipse at top, #0d1f22 0%, #121212 60%);
    min-height: 100vh;
    color: #ffffff;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "header header"
        "search search"
        "filter recipes";
    grid-template-rows: auto auto 1fr;
}

@media (max-width: 1023px) {
    body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "search"
            "recipes";
    }
}


.search-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 20px;
    gap: 8px;
    grid-area: search;
    padding: 0 20px;
    box-sizing: border-box;
}

.search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 500px;
    min-width: 200px;
}

#search-input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    font-size: 16px;
    border: 1px solid #00d6f7;
    border-radius: 10px;
    height: 40px;
    box-sizing: border-box;
    background-color: #1f1f1f;
    color: #fff;
}

#search-input::placeholder {
    color: #999;
}

#search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.2);
}
.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;

    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;

    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;

    transition: color 0.15s ease;
}

.clear-search-btn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover,
.clear-search-btn:focus,
.clear-search-btn:active {
    color: #00d6f7;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: translateY(-50%);
}

#filter-btn {
    padding: 0 16px;
    background-color: #00d6f7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    height: 40px;
    font-family: 'Georgia', serif;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
    transition: all 0.15s ease;
}

#filter-btn:hover {
    background-color: #00b8d4;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
}

@media (min-width: 1024px) {
    #filter-btn {
        display: none;
    }
}

.toolbar-btn {
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    background-color: #00d6f7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background-color: #00b8d4;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 188, 212, 0.2);
}

#add-recipe-btn {
    font-weight: 600;
}



#filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgba(0,0,0,0.65);
    z-index: 1000;
}

#filter-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    #filter-overlay {
        display: block;
        position: static;
        inset: auto;
        padding: 20px 12px;
        box-sizing: border-box;
        background-color: transparent;
        z-index: auto;
        grid-area: filter;
        height: auto;
        overflow-y: auto;
        min-width: 280px;
    }
    
    #filter-overlay.active {
        display: block;
        position: static;
        justify-content: unset;
        align-items: unset;
    }
}

#filter-popup {
    width: 100%;
    max-width: 360px;
    max-height: 82vh;
    overflow-y: auto;

    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid #00d6f7;
    padding: 22px;
    border-radius: 24px;

    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
}
#filter-popup.active {
    display: flex;
}

@media (min-width: 1024px) {
    #filter-popup {
        width: 260px;
        max-width: none;
        max-height: none;
        overflow-y: auto;
        background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
        border: 1px solid #00d6f7;
        padding: 16px;
        border-radius: 12px;
        box-shadow:
            0 8px 24px rgba(0,0,0,0.4),
            inset 0 1px 0 rgba(255,255,255,0.04);
    }
    
    #filter-popup .popup-actions,
    #filter-popup #apply-filters,
    #filter-popup #close-filter {
        display: none !important;
    }
}

#filter-popup .filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 18px;
}

@media (min-width: 1024px) {
    #filter-popup .filter-header {
        margin-bottom: 14px;
    }
}

#filter-popup h3 {
    margin: 0;
    font-size: 24px;
    color: #00d6f7;
    letter-spacing: 0.02em;
}

@media (min-width: 1024px) {
    #filter-popup h3 {
        font-size: 18px;
        margin: 0;
    }
}

.filter-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;

    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;

    background: transparent;
    color: #ff5555;
    border: 1px solid #00d6f7;
    border-radius: 10px;

    cursor: pointer;
    font-family: inherit;
    font-size: 17px;
    line-height: 1;
    box-sizing: border-box;

    box-shadow: none;
    transform: none;
    transition:
        color 0.15s ease,
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.filter-reset-btn:hover,
.filter-reset-btn:focus-visible {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
    border-color: rgba(255, 85, 85, 0.75);
    box-shadow: 0 0 0 3px rgba(255, 85, 85, 0.12);
    transform: none;
    outline: none;
}

.filter-reset-btn:active {
    background: rgba(255, 85, 85, 0.16);
    border-color: rgba(255, 85, 85, 0.9);
    transform: none;
}

#filter-popup .filter-section > label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    color: #e8f7ff;
    font-family: 'Georgia', serif;
}

@media (min-width: 1024px) {
    #filter-popup .filter-section > label {
        margin-bottom: 8px;
        font-size: 14px;
        gap: 8px;
    }
}

/* Accordion komplett isoliert */
#filter-popup .accordion-content label {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
    margin-bottom: 0;
}

/* WICHTIG: kein globales label mehr */

#filter-popup input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00d6f7;
    margin: 0;
}

@media (min-width: 1024px) {
    #filter-popup input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

#filter-popup input[type="number"],
#filter-popup input[type="text"] {
    width: 100%;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #444;
    background-color: #292929;
    color: #ffffff;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    #filter-popup input[type="number"],
    #filter-popup input[type="text"] {
        padding: 8px 10px;
        margin-bottom: 10px;
        font-size: 14px;
        border-radius: 10px;
    }
}

#filter-popup .filter-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#filter-popup .filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    #filter-popup .filter-section {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
}

#filter-popup h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (min-width: 1024px) {
    #filter-popup h4 {
        font-size: 11px;
        margin: 0 0 8px 0;
    }
}

#filter-popup .popup-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

#filter-popup button {
    flex: 1;
    min-width: 0;
    font-family: Georgia, serif;
}

#filter-popup .filter-header .filter-reset-btn {
    flex: none;
    width: 36px;
    min-width: 36px;
}

@media (min-width: 1024px) {
    #filter-popup .filter-header .filter-reset-btn {
        width: 30px;
        height: 30px;
        padding: 0;
        font-size: 16px;
    }
}

.recipe-card {
    position: relative;
    background: linear-gradient(160deg, #2f2f2f 0%, #232323 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow:
        0 4px 8px rgba(0,0,0,0.45),
        0 1px 3px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;

    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card .scale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(0, 188, 212, 0.95);
    color: #0f1720;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.recipe-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow:
        0 20px 40px rgba(0,0,0,0.55),
        0 6px 16px rgba(0, 188, 212, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.07);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-no-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: linear-gradient(135deg, #1e2e30, #1a2224);
}

.detail-no-image {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    background: linear-gradient(135deg, #1e2e30, #1a2224);
    border-radius: 14px;
    margin-bottom: 16px;
}

.card-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px 12px;
    flex: 1;
}

.card-title-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.card-nutrition {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #ffffff;
    flex-wrap: wrap;
    width: 100%;
}

.nutrition-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nutrition-item strong {
    color: #00d6f7;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(17px * 1.3 * 2);
    word-break: break-word;
    flex: 1;
}
.delete-btn,
.favorite-btn,
.edit-btn {
    background: none;
    border: 1px solid transparent;
    color: #666;
    font-size: 16px;
    font-family: Georgia, serif;
    cursor: pointer;
    padding: 4px 6px;
    height: 40px;
    box-shadow: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.delete-btn:hover,
.favorite-btn:hover,
.edit-btn:hover,
.edit-btn:focus-visible {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
    border-color: #ff5555;
    transform: none;
    box-shadow: none;
    outline: none;
}

.delete-btn:focus-visible,
.favorite-btn:focus-visible {
        outline: none;
}

#recipe-list {
    padding: 20px;
    grid-area: recipes;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    #recipe-list {
        max-height: calc(100vh - 140px);
    }
}

#favorites-btn {
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    background-color: #00d6f7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

#favorites-btn:hover {
    background-color: #00b8d4;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
    transform: translateY(-1px);
}

#trash-btn {
    height: 40px;
    min-width: 40px;
    padding: 0 12px;
    background-color: #00d6f7;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

#trash-btn:hover {
    background-color: #00b8d4;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
    transform: translateY(-1px);
}

#trash-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 188, 212, 0.2);
}

#trash-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#trash-popup {
    width: min(480px, 94vw);
    max-height: 85vh;
    overflow-y: auto;

    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 24px;
    padding: 24px;

    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);

    color: #fff;
    font-family: Georgia, serif;
}

/* Titel */
#trash-popup h3 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #00d6f7;
}

/* Liste */
.trash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.trash-item:last-child {
    border-bottom: none;
}

/* linke Seite (Textblock) */
.trash-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trash-item-name {
    font-size: 15px;
    color: #e8f7ff;
}

.trash-item-days {
    font-size: 12px;
    color: #00d6f7;
    opacity: 0.8;
}

#trash-overlay,
#trash-overlay * {
    font-family: Georgia, serif !important;
}



.trash-buttons {
    display: flex;
    gap: 8px;
}


#recipe-detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#recipe-detail-popup {
    position: relative;
    width: min(520px, 94vw);
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 24px;
    padding: 28px;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    color: #ffffff;
}

#close-detail {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    box-shadow: none;
    transition: color 0.15s;
}

#close-detail:hover {
    color: #fff;
    transform: none;
    box-shadow: none;
}

#recipe-detail-content img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

#recipe-detail-content h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 24px;
    text-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

#recipe-detail-content h4 {
    color: #00d6f7;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 0 8px;
}

.detail-description {
    color: #ccc;
    margin: 0 0 14px;
    line-height: 1.6;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.detail-meta span {
    background: rgba(0, 188, 212, 0.12);
    border: 1px solid rgba(0, 188, 212, 0.25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: #00d6f7;
}

#recipe-detail-content ul {
    padding-left: 20px;
    color: #ddd;
    line-height: 1.8;
    margin: 0;
}

#recipe-detail-content p {
    color: #ddd;
    line-height: 1.7;
    margin: 0;
}

#recipe-detail-content p {
    white-space: pre-line;
}

.detail-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.detail-header h2 {
    margin: 0;
    min-width: 0;
}

.detail-scaling-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 16px;
    border: none;
    background: transparent;
    box-shadow: none;
    justify-self: center;
}

.detail-scaling-label {
    /* Visuell ausblenden, im DOM bleiben für Accessibility falls benötigt */
    display: none;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
}

.portion-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 16px;
    background: rgba(0, 188, 212, 0.12);
    border: 1px solid rgba(0, 188, 212, 0.22);
    padding: 4px 6px;
}

.portion-control button {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(0, 188, 212, 0.4);
    background: rgba(0, 188, 212, 0.15);
    color: #00d6f7;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}

.portion-control button:hover {
    background: rgba(0, 188, 212, 0.24);
    transform: translateY(-1px);
}

.portion-control input {
    width: 52px;
    height: 32px;
    border: 1px solid rgba(0, 188, 212, 0.35);
    border-radius: 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.18);
    color: #00d6f7;
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    -moz-appearance: textfield;
    appearance: textfield;
}

.portion-control input::-webkit-outer-spin-button,
.portion-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.portion-control input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.portion-control input:focus {
    outline: none;
    border-color: rgba(0, 188, 212, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.12);
}

/* Mobile: kompakteres Layout für das Rezept-Popup und Portionen-Control */
@media (max-width: 600px) {
    #recipe-detail-popup {
        padding: 18px;
    }

    .detail-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: start;
        margin-bottom: 8px;
    }

    .detail-header h2 {
        grid-column: 1 / 2;
        grid-row: 1;
        margin: 0;
        min-width: 0;
    }

    .detail-header .edit-btn {
        grid-column: 2 / 3;
        grid-row: 1;
        justify-self: end;
        flex: none;
    }

    .detail-scaling-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        width: auto;
        align-self: start;
    }

    /* Skalierungs-Controls direkt unter dem Titel, so schmal wie nötig */
    .detail-scaling-controls {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 4px 6px;
        border-radius: 12px;
        background: transparent;
        box-shadow: none;
        width: auto;
        align-self: flex-start;
    }

    .detail-scaling-label {
        display: none;
    }

    .portion-control {
        padding: 2px 4px;
        gap: 6px;
        border-radius: 12px;
    }

    .portion-control button {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        font-size: 16px;
        padding: 0;
    }

    .portion-control input {
        width: 48px;
        height: 40px;
        font-size: 15px;
    }

    /* Verhindere, dass Header-Elemente sich über die volle Breite auseinanderziehen */
    .detail-header > * {
        flex: 0 0 auto;
    }
}

.recipe-detail {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

#add-recipe-form .checkbox-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;

    font-size: 15px;
    font-weight: 500;

    color: #ddd; /* WICHTIG: gleiche Farbe wie Filter */
}

#add-recipe-form {
    position: relative;
    margin: 60px auto;
    width: 360px;
    max-width: 92vw;
    max-height: 84vh;
    overflow-y: auto;
    background-color: #1f1f1f;
    border: 1px solid rgba(0, 188, 212, 0.25);
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}

#add-recipe-form label {
    text-transform: none;
    font-weight: normal;
    letter-spacing: normal;
}
#add-recipe-form .form-group > label {
    font-size: 15px;
    font-weight: 600;
    color: #00d6f7;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#add-recipe-form .checkbox-list label {
    display: flex;
    align-items: center;
    gap: 6px;              /* kleiner als 10px */
    margin-bottom: 4px;    /* statt 10px */
    font-size: 15px;
    color: #e8f7ff;
}

#add-recipe-form .checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#add-recipe-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #00d6f7;
    font-size: 24px;
}

.form-group {
    margin-bottom: 16px;
}

#add-recipe-form .form-group label {
    display: block;
    margin-bottom: 10px;

    font-size: 13px;

    color: #ffffff;

    letter-spacing: 0.08em;
}

#add-recipe-form .accordion-content label {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    margin: 0
}

#add-recipe-form .accordion-content label span {
    letter-spacing: normal !important;
    flex: 1;
    display: block;

    padding: 8px 10px;
    border-radius: 8px;

    background: rgba(255,255,255,0.04);
    color: #ddd;

    font-size: 16px !important;
    line-height: 1.4;

    transition: 0.15s;
}

/* hover wie Filter */
#add-recipe-form .accordion-content label:hover span {
    background: rgba(0, 188, 212, 0.15);
}

#add-recipe-form .accordion-content {
    display: none;
    flex-direction: column;
    gap: 5px; /* oder 3px, je nachdem wie dein Filter genau ist */
}

#add-recipe-form .accordion-content.open {
    display: flex;
}

#add-recipe-form .accordion-content label span {
    padding: 6px 10px;
}

/* checked state wie Filter */
#add-recipe-form .accordion-content
input[type="checkbox"]:checked + span {
    background: #00d6f7;
    color: #0b0b0b;
    font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #444;
    border-radius: 14px;
    background-color: #292929;
    color: #ffffff;
}

#add-recipe-form textarea {
    min-height: 80px;
}

#add-recipe-form .popup-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

#add-recipe-form button {
    flex: 1;
    min-width: 0;
}

button {
    padding: 10px 15px;
    background: linear-gradient(145deg, #00d4ee, #00a3b5);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow:
        0 4px 10px rgba(0, 188, 212, 0.3),
        0 2px 4px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: 'Georgia', serif;
}

.mode-btn {
    font-family: 'Georgia', serif;
}

button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 18px rgba(0, 188, 212, 0.4),
        0 3px 6px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

button:active {
    transform: translateY(1px);
    box-shadow:
        0 2px 4px rgba(0, 188, 212, 0.2),
        inset 0 2px 5px rgba(0,0,0,0.25);
}

.recipe-card, .recipe-detail {
    background: linear-gradient(160deg, #2f2f2f 0%, #232323 100%);
    color: #ffffff;
}

#for-you h2, #recipe-list h2 {
    text-shadow: 0 2px 10px rgba(0, 188, 212, 0.25);
}

input, select, textarea {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.35);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Georgia', serif;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #00d6f7;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.35), 0 0 0 2px rgba(0, 188, 212, 0.15);
}

#add-recipe-overlay {
    display: none;
    position: fixed;
    inset: 0;

    padding: 20px;
    box-sizing: border-box;

    background-color: rgba(0,0,0,0.72);
    z-index: 1000;
}

/* wenn offen = sauber zentriert */
#add-recipe-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

#add-recipe-form {
    position: relative;
    width: min(360px, 92vw);
    max-height: 84vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 188, 212, 0.2);
    padding: 22px;
    border-radius: 24px;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    color: #ffffff;
}

#add-recipe-form h3 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #00d6f7;
    font-size: 24px;
}

#add-recipe-form .form-group {
    margin-bottom: 16px;
}


#add-recipe-form .checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    color: #e8f7ff;
}

#add-recipe-form .checkbox-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00d6f7;
    margin: 0;
}

#add-recipe-form input,
#add-recipe-form select,
#add-recipe-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #444;
    background-color: #292929;
    color: #ffffff;
    box-sizing: border-box;
    font-family: 'Georgia', serif;
}

#add-recipe-form textarea {
    min-height: 90px;
}

#recipe-text-input {
    min-height: 140px;
}

.ai-parse-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ai-parse-actions button {
    flex: none;
    height: 36px;
    padding: 0 14px;
    background: #00d6f7;
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.ai-parse-actions button:hover:not(:disabled) {
    transform: none;
    background: #00d6f7;
}

.ai-parse-actions button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.import-scale-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    font-size: 0.95rem;
    color: #ffffff;
    flex: none;
}

.import-scale-control input {
    width: 76px;
    max-width: 90px;
    min-width: 60px;
    height: 36px;
    box-sizing: border-box;
    padding: 0 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-align: center;
    font-size: 0.95rem;
}

.import-scale-control input:focus {
    outline: 2px solid rgba(0, 214, 247, 0.45);
    outline-offset: 1px;
}


.ai-parse-actions .import-scale-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
    color: #ffffff;
    flex: none;
}

.ai-parse-actions .import-scale-control input {
    width: 76px;
    height: 40px;
    box-sizing: border-box;
    padding: 0 8px;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-align: center;
    font-size: 0.95rem;
    line-height: 40px;
}

.ai-parse-actions #parse-recipe-text-btn {
    height: 40px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    line-height: 1;
}

.parse-status {
    color: #b8fff8;
    font-size: 13px;
}

.parse-error {
    margin: 8px 0 0;
    color: #ff7f7f;
    font-size: 13px;
}

#recipe-image {
    padding: 8px;
    cursor: pointer;
}

#emoji-section {
    margin-top: 10px;
}

.emoji-mode-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 13px;
    background: #2a2a2a;
    color: #888;
    border: 1px solid #444;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mode-btn:hover {
    background: #333;
    color: #ccc;
    transform: none;
    box-shadow: none;
}

.mode-btn.active {
    background: rgba(0, 188, 212, 0.15);
    color: #00d6f7;
    border-color: rgba(0, 188, 212, 0.4);
    box-shadow: none;
}

.emoji-hint {
    color: #666;
    font-size: 13px;
    margin: 0;
    text-align: center;
    padding: 8px 0;
}

#emoji-ai-view {
    display: flex;
    gap: 12px;
    justify-content: center;
    min-height: 60px;
    align-items: center;
}

.emoji-ai-btn {
    font-size: 42px;
    background: #2a2a2a;
    border: 2px solid transparent;
    border-radius: 14px;
    width: 70px;
    height: 70px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.emoji-ai-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.emoji-ai-btn.selected {
    border-color:  #00d6f7;
    background: rgba(0, 188, 212, 0.15);
    box-shadow: 0 0 0 1px rgba(0, 188, 212, 0.3), 0 4px 10px rgba(0,0,0,0.3);
}

#emoji-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}

.emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-option {
    background: #2a2a2a;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 22px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s;
}

.emoji-option:hover {
    background: #333;
    transform: none;
    box-shadow: none;
}

.emoji-option.selected {
    border-color:  #00d6f7;
    background: rgba(0, 188, 212, 0.15);
    box-shadow: 0 0 0 1px rgba(0, 188, 212, 0.3);
}

.emoji-option.suggested {
    border-color: rgba(0, 188, 212, 0.4);
    background: rgba(0, 188, 212, 0.07);
}

#recipe-image-preview {
    display: none;
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#add-recipe-form .popup-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 10px;
}

#add-recipe-form .popup-actions button {
    flex: 1;
}

#add-recipe-form .popup-actions button:first-child {
    margin-right: 0;
}



.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* GROUP */
.accordion-group {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

@media (min-width: 1024px) {
    .accordion-group {
        border-radius: 8px;
        margin-bottom: 6px;
    }
}

/* HEADER */
.accordion-header {
    padding: 10px 12px;
    background: #2a2a2a;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 15px;
}

.accordion-header:hover,
.accordion-header:focus-visible {
    background: #3a3a3a;
    outline: none;
    box-shadow: none;
}

@media (min-width: 1024px) {
    .accordion-header {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* CONTENT WRAPPER */
.accordion-content {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    background: #2a2a2a;
}

.accordion-content.open {
    display: flex;
}

@media (min-width: 1024px) {
    .accordion-content {
        gap: 3px;
        padding: 8px 10px;
    }
}

/* =========================
   FILTER-SAFE LABEL SYSTEM
   (NO GLOBAL SIDE EFFECTS)
   ========================= */

.accordion-content label {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

/* hide checkbox safely (NO layout breaking) */
.accordion-content label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* pill style */
.accordion-content label span {
    flex: 1;
    display: block;

    padding: 8px 10px;
    border-radius: 8px;

    background: rgba(255,255,255,0.04);
    color: #ddd;

    transition: 0.15s;
    font-size: 14px;
}

@media (min-width: 1024px) {
    .accordion-content label span {
        padding: 6px 8px;
        font-size: 13px;
        border-radius: 6px;
    }
}

/* hover */
.accordion-content label:hover span {
    background: rgba(0, 188, 212, 0.15);
}

/* checked state */
.accordion-content label input[type="checkbox"]:checked + span {
    background: #00d6f7;
    color: #0b0b0b;
    font-weight: 600;
}

#recipes-grid {
    display: flex;
    flex-direction: column;
    gap: 34px;
    width: 100%;
}

.meal-section {
    margin-bottom: 42px;
}

.meal-heading {
    font-size: 17px;
    font-weight: 600;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    color:  #ffffff;

    margin: 0 0 16px;
    padding-bottom: 8px;

    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    align-items: start;
}

.meal-grid .recipe-card {
    width: 100%;
}

@media (min-width: 1024px) {
    .meal-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    }
}

@media (max-width: 768px) {
    .meal-grid {
        grid-template-columns: 1fr;
    }  
    
    .search-container {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Suchfeld soll trotzdem groß bleiben */
    #search-input {
        flex: 1;
        min-width: 0;
    }

    /* alle oberen Buttons kompakt */
    #filter-btn,
    #add-recipe-btn,
    #favorites-btn,
    #trash-btn,
    #login-btn,
    #logout-btn {
        width: 40px;
        height: 40px;
        padding: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 17px;
        border-radius: 10px;

        flex-shrink: 0;
        line-height: 1;
    }
}

body:not(.admin) .edit-btn,
body:not(.admin) .delete-btn,
body:not(.admin) #add-recipe-btn {
    display: none;
}

.auth-btn {
    font-size: 16px;
    font-family: Georgia, serif;
    padding: 8px 14px;
    height: 40px;
    background-color: #0d1f22;
    color: #fff;
    cursor: pointer;
    transition: 0.2s ease;
}

.auth-btn:hover {
    background-color: #1b3a3f;
}


#login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9999;

    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* DAS ist der wichtige Teil (wie filter-popup) */
#login-overlay .modal {
    width: 100%;
    max-width: 360px;
    max-height: 82vh;
    overflow-y: auto;

    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 188, 212, 0.2);
    padding: 22px;
    border-radius: 24px;

    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);

    font-family: Georgia, serif;
}

/* Titel wie Filter */
#login-overlay h2 {
    margin: 0 0 18px;
    font-size: 24px;
    color: #00d6f7;
    letter-spacing: 0.02em;
}

/* Inputs identisch zum Filter */
#login-overlay input {
    width: 100%;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;

    border: 1px solid #444;
    background-color: #292929;
    color: #ffffff;

    box-sizing: border-box;
    font-size: 15px;
    font-family: Georgia, serif;
}

/* Buttons unten wie filter actions */
#login-overlay .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 8px;
}

#login-overlay .modal button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 14px;
    border-radius: 14px;

    background-color: #292929 !important;
    border: 1px solid rgba(0, 188, 212, 0.3) !important;

    color: #00d6f7;

    font-family: Georgia, serif;
    font-size: 15px;

    cursor: pointer;
    transition: all 0.2s ease;
}

#login-overlay .modal #login-close {
    background-color: #00d6f7;
    border: 1px solid #00d6f7;
    color: #ffffff !important;
}

#login-overlay .modal button:hover {
    background-color: rgba(0, 188, 212, 0.12) !important;
    border-color: #00d6f7 !important;
}

#logout-overlay {
    display: none;
}

#logout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9999;

    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#logout-overlay .modal {
    width: 100%;
    max-width: 360px;

    background: linear-gradient(160deg, #242424 0%, #1a1a1a 100%);
    border: 1px solid rgba(0, 188, 212, 0.2);
    border-radius: 24px;
    padding: 22px;

    box-shadow:
        0 32px 80px rgba(0,0,0,0.65),
        0 8px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);

    font-family: Georgia, serif;
    color: #00d6f7;
}

#logout-overlay .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 16px;
}

#logout-overlay p {
    color: #ffffff;
}

#logout-overlay button {
    padding: 10px 14px;
    border-radius: 14px;

    background-color: #292929;
    border: 1px solid rgba(0, 188, 212, 0.3);

    color: #fff ;
    font-family: Georgia, serif;
    font-size: 15px;

    cursor: pointer;
    transition: 0.2s;
}

#logout-overlay button:hover {
    background-color: rgb(255, 255, 255);
    border-color: #00d6f7;
}


body.modal-open {
    overflow: hidden;
}


#add-recipe-form .form-group .import-scale-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    height: 40px;
    line-height: 1;
}

#add-recipe-form .form-group .import-scale-control input {
    height: 40px;
    box-sizing: border-box;
    margin: 0;
}

#parse-recipe-text-btn {
    height: 40px;
    box-sizing: border-box;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#recipe-ingredients-list .ingredient-heading {
    list-style: none;
    margin-left: -1.2em;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

#recipe-ingredients-list .ingredient-heading:first-child {
    margin-top: 0;
}

#recipe-ingredients-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.accordion-group {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #2a2a2a;
}

@media (min-width: 1024px) {
    .accordion-group {
        border-radius: 8px;
        margin-bottom: 6px;
    }
}

.accordion-header {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    font-size: 15px;
    text-align: left;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

.accordion-header:hover,
.accordion-header:focus-visible {
    background: #3a3a3a;
    outline: none;
    box-shadow: none;
}

@media (min-width: 1024px) {
    .accordion-header {
        padding: 8px 10px;
        font-size: 13px;
    }
}

.accordion-content {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 4px 12px 12px;
    background: #2a2a2a;
}

.accordion-content.open {
    display: flex;
}

@media (min-width: 1024px) {
    .accordion-content {
        gap: 4px;
        padding: 4px 10px 10px;
    }
}

.accordion-item {
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    color: #ddd;
    line-height: 1.8;
    margin: 0;
    border-radius: 8px;
}

.accordion-item + .accordion-item {
    margin-top: 0;
}

.ingredient-heading {
    padding: 0;
    margin: 0;
    font-weight: 700;
    color: #fff;
    background: transparent;
}

@media (min-width: 1024px) {
    .accordion-item {
        padding: 8px 10px;
    }
}
