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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #5B3A29;
    background: #F6ECD9;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 250, 240, 0.9);
    backdrop-filter: blur(4px);
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(215, 150, 90, 0.25);
    box-shadow: 0 2px 10px rgba(90, 60, 40, 0.08);
}

nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 1rem;
}

nav a {
    color: #5B3A29;
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

nav a:hover {
    background: #D9864B;
    color: white;
}

/* Main Area */
main {
    margin-top: 70px;
    padding: 20px 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Homepage */
#startseite {
    text-align: center;
    padding: 30px 20px;
    background: #FFF7EA;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(80, 50, 30, 0.08);
    border: 2px solid rgba(217, 134, 75, 0.25);
}

#startseite h1 {
    color: #4F6F52;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

/* Bildcontainer */
.hero-image {
    width: 280px;
    height: 180px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(80, 50, 30, 0.15);
    margin: 0 auto 20px;
}

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

#startseite p {
    max-width: 100%;
    margin: 0 auto 20px;
    font-size: 1rem;
    color: #5B3A29;
    padding: 0 10px;
}

/* Buttons */
.start-button {
    display: inline-block;
    background: #9BC58C;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(80, 120, 60, 0.15);
    border: none;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 1rem;
}

.start-button:hover {
    background: #4F6F52;
    transform: translateY(-2px);
}

/* Aufklappbarer Bereich Styling */
.expandable-section {
    margin: 1.5rem auto 0;
    border: 1px solid #D9864B;
    border-radius: 10px;
    overflow: hidden;
    max-width: 100%;
    background: #FFF;
    box-shadow: 0 3px 10px rgba(90, 60, 40, 0.1);
}

.content-text {
    padding: 1.5rem;
    line-height: 1.6;
    text-align: left;
}

.content-text h3 {
    margin-top: 0;
    color: #4F6F52;
    border-bottom: 2px solid #9BC58C;
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

/* Preview Text (immer sichtbar) */
.preview-text {
    margin-bottom: 1rem;
    text-align: justify;
    color: #5B3A29;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Collapsed Content Bereich - ZUVERLÄSSIGE LÖSUNG */
.collapsed-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s ease;
}

.collapsed-content.active {
    max-height: 10000px; /* Sollte für deinen Content ausreichen */
}

/* Styles für den erweiterten Inhalt */
.collapsed-content h4 {
    margin: 1.5rem 0 0.8rem 0;
    color: #D9864B;
    font-size: 1.1rem;
    border-bottom: 1px solid #E8D0B3;
    padding-bottom: 0.4rem;
}

.collapsed-content p {
    margin-bottom: 1rem;
    text-align: justify;
    color: #5B3A29;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* More/Less Button */
.more-button {
    display: block;
    margin: 1rem auto 0;
    background: #D9864B;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.more-button:hover {
    background: #BF6F3A;
    transform: translateY(-2px);
}

/* Buch Navigation */
.buch-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem;
    background: #FFF7EA;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(80, 50, 30, 0.1);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-button {
    background: #9BC58C;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    flex: 1;
    min-width: 120px;
}

.nav-button:hover:not(:disabled) {
    background: #4F6F52;
    transform: translateY(-2px);
}

.nav-button:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    transform: none;
}

#seiten-info {
    font-weight: bold;
    color: #4F6F52;
    font-size: 1rem;
    text-align: center;
    flex-basis: 100%;
    order: -1;
    margin-bottom: 0.5rem;
}

/* Kapitel Styling */
.kapitel {
    background: #FFF7EA;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(80, 50, 30, 0.1);
    margin-bottom: 1.5rem;
}

.kapitel h2 {
    color: #4F6F52;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 3px solid #9BC58C;
    padding-bottom: 0.8rem;
}

.rezept {
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 5px rgba(80, 50, 30, 0.08);
    border-left: 4px solid #D9864B;
}

.rezept h3 {
    color: #4F6F52;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.zutaten, .anleitung {
    margin-bottom: 0.8rem;
}

.zutaten h4, .anleitung h4 {
    color: #D9864B;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.zutaten ul, .anleitung ol {
    margin-left: 1.2rem;
    color: #5B3A29;
}

.zutaten li, .anleitung li {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: #4F6F52;
    color: #FFF7EA;
    padding: 30px 15px;
    text-align: center;
    margin-top: 2rem;
}

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

.footer-links {
    margin-top: 0.8rem;
}

.footer-links a {
    color: #FFF7EA;
    margin: 0 0.8rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Media Queries für größere Bildschirme */
@media (min-width: 768px) {
    /* Header */
    nav ul {
        gap: 2rem;
    }
    
    nav a {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    /* Main Area */
    main {
        margin-top: 90px;
        padding: 40px 20px;
    }
    
    /* Homepage */
    #startseite {
        padding: 60px 40px;
        border-radius: 20px;
    }
    
    #startseite h1 {
        font-size: 2.8rem;
        margin-bottom: 1.5rem;
    }
    
    /* Bildcontainer */
    .hero-image {
        width: 320px;
        height: 220px;
        border-radius: 18px;
        margin: 0 auto 30px;
    }
    
    #startseite p {
        max-width: 700px;
        margin: 0 auto 25px;
        font-size: 1.15rem;
        padding: 0;
    }
    
    /* Buttons */
    .start-button {
        padding: 14px 32px;
        border-radius: 14px;
        margin-bottom: 30px;
        font-size: 1.1rem;
    }
    
    /* Aufklappbarer Bereich */
    .expandable-section {
        margin: 2rem auto 0;
        max-width: 800px;
        border-radius: 12px;
    }
    
    .content-text {
        padding: 2rem;
    }
    
    .content-text h3 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .preview-text {
        font-size: 1.05rem;
        line-height: 1.6;
    }
    
    .collapsed-content h4 {
        margin: 2rem 0 1rem 0;
        font-size: 1.2rem;
    }
    
    .collapsed-content p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .more-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    /* Buch Navigation */
    .buch-navigation {
        margin-bottom: 2rem;
        padding: 1rem;
        border-radius: 12px;
        flex-wrap: nowrap;
    }
    
    .nav-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        flex: none;
        min-width: auto;
    }
    
    #seiten-info {
        font-size: 1.1rem;
        flex-basis: auto;
        order: 0;
        margin-bottom: 0;
    }
    
    /* Kapitel Styling */
    .kapitel {
        padding: 2rem;
        border-radius: 16px;
        margin-bottom: 2rem;
    }
    
    .kapitel h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .rezept {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .rezept h3 {
        font-size: 1.3rem;
    }
    
    .zutaten li, .anleitung li {
        font-size: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 40px 20px;
        margin-top: 3rem;
    }
    
    .footer-links a {
        font-size: 1rem;
        margin: 0 1rem;
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 360px) {
    nav ul {
        gap: 0.5rem;
    }
    
    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    main {
        margin-top: 60px;
        padding: 15px 10px;
    }
    
    .hero-image {
        width: 250px;
        height: 160px;
    }
    
    .nav-button {
        min-width: 100px;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Rezept-Formular Styling */
#rezept-formular {
    max-width: 800px;
    margin: 0 auto;
}

.formular-container {
    background: #FFF7EA;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(80, 50, 30, 0.08);
    border: 2px solid rgba(217, 134, 75, 0.25);
}

.formular-container h2 {
    color: #4F6F52;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    border-bottom: 3px solid #9BC58C;
    padding-bottom: 0.8rem;
}

.formular-container > p {
    text-align: center;
    margin-bottom: 2rem;
    color: #5B3A29;
}

.recipe-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #4F6F52;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid #E8D0B3;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #D9864B;
}

.form-section {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(80, 50, 30, 0.08);
    border-left: 4px solid #D9864B;
}

.form-section h3 {
    color: #4F6F52;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #9BC58C;
    padding-bottom: 0.5rem;
}

.ingredient-row,
.instruction-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    align-items: flex-start;
}

.ingredient-input {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #E8D0B3;
    border-radius: 6px;
    font-size: 0.95rem;
}

.instruction-input {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #E8D0B3;
    border-radius: 6px;
    font-size: 0.95rem;
    min-height: 80px;
    resize: vertical;
}

.remove-ingredient,
.remove-instruction {
    background: #FF6B6B;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.remove-ingredient:hover,
.remove-instruction:hover {
    background: #FF5252;
}

.add-button {
    background: #9BC58C;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.add-button:hover {
    background: #4F6F52;
    transform: translateY(-2px);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #E8D0B3;
}

.cancel-button {
    background: #CCCCCC;
    color: #666;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.cancel-button:hover {
    background: #BBBBBB;
    transform: translateY(-2px);
}

.submit-button {
    background: #D9864B;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.submit-button:hover {
    background: #BF6F3A;
    transform: translateY(-2px);
}

/* Media Queries für Formular */
@media (max-width: 768px) {
    .formular-container {
        padding: 1.5rem;
    }
    
    .ingredient-row,
    .instruction-row {
        flex-direction: column;
    }
    
    .remove-ingredient,
    .remove-instruction {
        align-self: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .cancel-button,
    .submit-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .formular-container {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
}