/* =============================================
   REZEPTE GURU - RECIPE CARDS v3.0
   Bessere Lesbarkeit, keine Überlappung
   ============================================= */

/* =============================================
   BRING! EXPORT BUTTON
   ============================================= */

.bring-export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.bring-export-btn:hover {
    background: linear-gradient(135deg, #E55A25, #E8820E);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.bring-export-btn:active {
    transform: translateY(0);
}

.bring-export-btn i {
    font-size: 1.1rem;
}

/* =============================================
   RECIPE CARDS - NEUES DESIGN
   ============================================= */

.recipe-card {
    position: relative;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 1;
}

.recipe-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

/* === BILD BEREICH === */
.recipe-card-image {
    position: relative;
    width: 100%;
    height: var(--card-image-height, 180px);
    overflow: hidden;
    background: var(--bg-primary, #0f172a);
    transition: height 0.3s ease;
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Placeholder ohne Bild */
.recipe-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-muted, #475569);
    font-size: 3rem;
}

/* === KATEGORIE BADGE - OBEN LINKS === */
.recipe-card-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.recipe-card-category {
    display: inline-block;
    background: var(--accent-primary, #6366f1);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* === DIET BADGE - OBEN RECHTS === */
.recipe-card-diet-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.recipe-card-diet {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.recipe-card-diet.vegetarian {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.recipe-card-diet.vegan {
    background: rgba(22, 163, 74, 0.9);
    color: white;
}

/* === CONTENT BEREICH - UNTEN === */
.recipe-card-content {
    background: linear-gradient(to top, 
        rgba(15, 23, 42, 0.98) 0%, 
        rgba(15, 23, 42, 0.95) 40%,
        rgba(15, 23, 42, 0.85) 70%,
        transparent 100%
    );
    padding: 50px 14px 14px 14px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Recipe Grid niedrig damit Dropdown darüber */
.recipe-grid {
    position: relative;
    z-index: 1;
}

/* === MODAL Z-INDEX FIX === */
.modal {
    z-index: 9999 !important;
}

.modal .modal-backdrop {
    z-index: 9998;
}

.modal .modal-content {
    z-index: 10000;
    position: relative;
}

/* Toast über allem */
.toast-container {
    z-index: 99999 !important;
}

/* === BOTTOM NAV - IMMER SICHTBAR === */
/* Navigation bleibt auf allen Geräten sichtbar (auch Tablet/Querformat) */

/* =============================================
   FAVORITEN HERZ AUF KARTEN
   ============================================= */

.recipe-card-fav {
    position: absolute;
    bottom: 70px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    z-index: 5;
}

.recipe-card-fav:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #f87171;
    transform: scale(1.1);
}

.recipe-card-fav.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.recipe-card-fav.active:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* =============================================
   SHOPPING BADGE (Bottom Nav)
   ============================================= */

.nav-item {
    position: relative;
}

.shopping-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(12px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   EINKAUFSLISTE VIEW
   ============================================= */

.shopping-list-container {
    background: var(--bg-glass, rgba(255,255,255,0.05));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.shopping-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary, rgba(255,255,255,0.08));
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    flex-wrap: wrap;
    gap: 12px;
}

.shopping-list-header span {
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.shopping-list-actions {
    display: flex;
    gap: 8px;
}

.shopping-list-actions .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
}

.shopping-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shopping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    transition: background 0.15s;
}

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

.shopping-item:hover {
    background: rgba(255,255,255,0.03);
}

.shopping-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.shopping-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary, #6366f1);
    cursor: pointer;
}

.shopping-item span {
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.95rem;
}

.shopping-item.checked span {
    text-decoration: line-through;
    color: var(--text-muted, #666);
}

.shopping-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted, #666);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
}

.shopping-item:hover .shopping-item-remove {
    opacity: 1;
}

.shopping-item-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Bring! Button Styling */
.btn-bring {
    background: linear-gradient(135deg, #FF6B35, #F7931E) !important;
    border: none !important;
}

.btn-bring:hover {
    background: linear-gradient(135deg, #E55A25, #E8820E) !important;
}

/* =============================================
   MOBILE ANPASSUNGEN FÜR NEUE FEATURES
   ============================================= */

@media (max-width: 768px) {
    .recipe-card-fav {
        width: 32px;
        height: 32px;
        bottom: 62px;
        right: 8px;
        font-size: 0.9rem;
    }
    
    .shopping-list-header {
        padding: 12px 16px;
    }
    
    .shopping-list-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .shopping-list-actions .btn {
        flex: 1;
    }
    
    .shopping-item {
        padding: 12px 16px;
    }
    
    .shopping-item-remove {
        opacity: 0.7;
    }
}

/* =============================================
   KATEGORIE TAGS - MODERN & DEZENT
   ============================================= */

#category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.category-tag-container {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-glass, rgba(255,255,255,0.06));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.category-tag-container:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.category-tag-container.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent-primary, #6366f1);
}

.category-tag-container.selected .category-tag-name {
    color: var(--accent-primary, #818cf8);
}

.category-tag-name {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0a0);
    transition: color 0.2s;
    padding-right: 4px;
}

/* Actions - nur bei Hover sichtbar (Desktop) */
.category-tag-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-tag-container:hover .category-tag-actions {
    opacity: 1;
}

/* Auf Touch-Geräten (Tablet/Mobile) immer sichtbar */
@media (hover: none) {
    .category-tag-actions {
        opacity: 0.7;
    }
}

/* Alternative: Auf kleinen Screens immer sichtbar */
@media (max-width: 1024px) {
    .category-tag-actions {
        opacity: 0.7;
    }
    
    .category-tag-container:active .category-tag-actions {
        opacity: 1;
    }
}

.cat-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted, #666);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.15s ease;
    padding: 0;
}

.cat-action-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #fff);
}

.cat-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* =============================================
   KATEGORIE MODALS
   ============================================= */

.category-modal-content {
    max-width: 360px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.category-modal-header {
    padding: 20px 24px;
    background: var(--bg-glass, rgba(255,255,255,0.05));
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
}

.category-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-modal-header h3 i {
    color: var(--accent-primary, #6366f1);
    font-size: 0.9rem;
}

.category-modal-header.delete {
    text-align: center;
    padding: 28px 24px 20px;
}

.category-modal-header.delete i {
    font-size: 2rem;
    color: #f87171;
}

.category-modal-body {
    padding: 20px 24px;
}

.category-modal-body.center {
    text-align: center;
}

.category-modal-body h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--text-primary, #fff);
}

.category-modal-body p {
    margin: 0;
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.95rem;
}

.category-modal-body p.hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted, #666);
}

.category-modal-body .form-input {
    width: 100%;
    margin-top: 4px;
}

.category-modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.category-modal-footer .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
}

/* === TITEL - GUT LESBAR === */
.recipe-card-title {
    font-size: var(--card-title-size, 1rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: font-size 0.3s ease;
}

/* === META INFOS === */
.recipe-card-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.recipe-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-card-meta i {
    font-size: 0.7rem;
    color: var(--accent-primary, #6366f1);
}

/* =============================================
   MODAL STYLES - Dark Theme
   ============================================= */

.modal-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    padding: 16px;
    background: var(--bg-glass, rgba(255,255,255,0.05));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    border-radius: var(--radius-md, 12px);
}

.modal-meta-info .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    padding: 8px 14px;
    background: var(--bg-secondary, rgba(255,255,255,0.08));
    border-radius: 20px;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}

.modal-meta-info .meta-item i {
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
}

.modal-meta-info .meta-item.rating {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fbbf24;
}

.modal-meta-info .meta-item.rating i {
    color: #fbbf24;
}

.modal-meta-info .meta-item.diet {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

.modal-meta-info .meta-item.diet i {
    color: #22c55e;
}

/* Modal Tags */
.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-chip {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* =============================================
   RESPONSIVE - MOBILE
   ============================================= */

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    /* Grid */
    .recipe-grid {
        padding: 10px;
        gap: 12px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Cards */
    .recipe-card {
        border-radius: 12px;
    }
    
    .recipe-card-image {
        height: var(--card-image-height, 130px);
    }
    
    /* Badges */
    .recipe-card-category-badge {
        top: 8px;
        left: 8px;
    }
    
    .recipe-card-category {
        padding: 4px 8px;
        font-size: 0.6rem;
        border-radius: 6px;
    }
    
    .recipe-card-diet-badge {
        top: 8px;
        right: 8px;
    }
    
    .recipe-card-diet {
        font-size: 0.55rem;
        padding: 4px 8px;
    }
    
    /* Content */
    .recipe-card-content {
        padding: 40px 10px 10px 10px;
    }
    
    .recipe-card-title {
        font-size: 0.85rem;
        margin-bottom: 5px;
        line-height: 1.3;
    }
    
    .recipe-card-meta {
        font-size: 0.7rem;
        gap: 10px;
    }
    
    /* Modal */
    .modal-content {
        padding: 16px;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    #modal-image-container {
        max-height: 200px;
        margin: 0 -16px 16px;
    }
    
    #modal-image {
        max-height: 200px;
        object-fit: cover;
        width: 100%;
    }
    
    .modal-meta-info {
        padding: 12px;
        gap: 8px;
    }
    
    .modal-meta-info .meta-item {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    /* Form */
    .form-input, .form-textarea {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    /* FAB */
    .fab {
        width: 54px;
        height: 54px;
        bottom: 80px;
        right: 16px;
    }
}

/* === EXTRA SMALL (< 400px) === */
@media (max-width: 400px) {
    .recipe-grid {
        gap: 8px;
        padding: 8px;
    }
    
    .recipe-card-image {
        height: var(--card-image-height, 110px);
    }
    
    .recipe-card-title {
        font-size: var(--card-title-size, 0.8rem);
    }
    
    .recipe-card-meta {
        font-size: 0.65rem;
        gap: 8px;
    }
    
    .recipe-card-category {
        font-size: 0.55rem;
        padding: 3px 6px;
    }
}

/* === TABLET === */
@media (min-width: 768px) and (max-width: 1024px) {
    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .recipe-card-image {
        height: var(--card-image-height, 160px);
    }
}

/* === DESKTOP === */
@media (min-width: 1025px) {
    .recipe-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1280px;
        margin: 0 auto;
        gap: 20px;
    }
    
    .recipe-card-image {
        height: var(--card-image-height, 200px);
    }
    
    .recipe-card-title {
        font-size: var(--card-title-size, 1.1rem);
    }
    
    .modal-content {
        max-width: 640px;
    }
    
    #modal-image-container {
        max-height: 320px;
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 20px;
    }
    
    #modal-image {
        max-height: 320px;
    }
}

/* === ZUSÄTZLICHE REZEPT-INFOS === */
.recipe-details-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.recipe-details-section summary {
    list-style: none;
    user-select: none;
}

.recipe-details-section summary::-webkit-details-marker {
    display: none;
}

.recipe-details-section[open] summary .fa-chevron-down {
    transform: rotate(180deg);
}

.form-label-small {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

