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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}
.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.search-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}
.tab {
    padding: 12px 24px;
    background: rgba(255,255,255,0.3);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}
.tab.active {
    background: white;
    color: #333;
    border-color: #fff;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 30px;
}
input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1em;
    border: none;
    border-radius: 50px;
    outline: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}
.recipe-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.4s;
    cursor: pointer;
}
.recipe-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}
.recipe-image {
    height: 200px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
}
.recipe-info {
    padding: 25px;
}
.recipe-title {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 10px;
}
.recipe-meta {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 15px;
}
.main-ingredient {
    background: #3498db;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
}

.no-results {
    text-align: center;
    color: white;
    padding: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* DETAIL PAGE */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: bold;
    padding: 12px 20px;
    background: white;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.recipe-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 40px;
    color: white;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.recipe-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}
.recipe-hero h1 {
    font-size: 3em;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.recipe-hero .meta {
    font-size: 1.2em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.recipe-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.portions-control {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}
.portions-btn {
    background: #3498db;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
}
.portions-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}
#portionsDisplay {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.ingredient {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 15px;
    border-left: 5px solid #3498db;
}

.instructions ol {
    padding-left: 30px;
    counter-reset: step;
}
.instructions li {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    counter-increment: step;
}
.instructions li::before {
    content: counter(step);
    background: #3498db;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

/* FORM ELEMENTS */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.ingredients-input, .instructions-input {
    border: 2px dashed #3498db;
    padding: 20px;
    border-radius: 15px;
    background: #f8f9fa;
    margin-bottom: 20px;
    min-height: 120px;
}
.add-item-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s;
}
.add-item-btn:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.1em;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s;
    display: block;
    margin: 30px auto;
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* ⭐ INTERAKTIVE BEWERTUNGSSTERNE */
.rating-stars {
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}
.rating-star {
    cursor: pointer;
    font-size: 2em;
    color: #ddd;
    transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
}
.rating-star.active {
    color: #f39c12;
}
.rating-star:hover {
    transform: scale(1.2) translateY(-2px);
    color: #f1c40f;
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.7);
}
.rating-star.preview {
    color: #f1c40f;
    transform: scale(1.1);
}

.source-link {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-block;
}
.source-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.4);
}

.ingredient-input-row, .source-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.ingredient-input-row input, .source-input-row input {
    flex: 1;
}

.rating {
    color: #f39c12;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}
.rating:hover {
    transform: scale(1.05);
}

.login-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.filter-bar {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.admin-header {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
}

.admin-login-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .search-tabs {
        flex-direction: column;
        align-items: center;
    }
    .recipes-grid, .form-grid {
        grid-template-columns: 1fr;
    }
    .recipe-hero h1 {
        font-size: 2em;
    }
    .section {
        padding: 25px;
    }
    .portions-control {
        flex-direction: column;
        gap: 10px;
    }
}

/* PRINT */
@media print {
    body {
        background: white !important;
    }
    .container {
        max-width: none;
    }
    .back-btn, .portions-control, #rating, button, .btn {
        display: none !important;
    }
    .section {
        box-shadow: none;
        margin: 10px 0;
        background: white;
    }
    .recipe-hero {
        background: white !important;
        color: black !important;
    }
}
