/* style.css */

/* --- GRUND-LAYOUT --- */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: #f4f4f9; 
    color: #333; 
    padding: 20px; 
    max-width: 800px; /* Begrenzt die Breite auf großen Bildschirmen */
    margin: 0 auto;   /* Zentriert die App auf dem PC */
    line-height: 1.6;
}

h1, h2, h3 { color: #222; text-align: center; }

/* --- NAVIGATION --- */
.nav { 
    background: #333; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 30px; 
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 15px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.nav a { 
    color: white; 
    text-decoration: none; 
    font-weight: bold; 
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.2s;
}
.nav a:hover { background: #555; }

/* --- FORMULARE (Login & Neues Rezept) --- */
input, select, textarea { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 15px; 
    box-sizing: border-box; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    font-family: inherit;
}
label { font-weight: bold; margin-bottom: 5px; display: block; }

#loading { 
    display: none; /* Wichtig: Am Anfang unsichtbar! */
    margin-top: 20px; 
    font-size: 20px; 
    color: #555; 
    font-weight: bold;
    text-align: center;
}

/* --- BUTTONS --- */
button { 
    padding: 12px 20px; 
    border: none; 
    border-radius: 6px; 
    font-size: 16px; 
    cursor: pointer; 
    font-weight: bold;
    width: 100%;
    transition: transform 0.1s, opacity 0.2s;
}
button:active { transform: scale(0.97); }

.btn-primary { background-color: #4caf50; color: white; }
.btn-primary:hover { opacity: 0.9; }

.btn-danger { background-color: #ff4d4d; color: white; text-decoration: none; padding: 6px 12px; border-radius: 4px; font-size: 14px; }
.btn-danger:hover { background-color: #cc0000; }

.wuerfel-btn { background-color: #ff6b6b; color: white; font-size: 24px; padding: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-bottom: 20px;}


/* --- LOGIN-BOX --- */
.login-box { 
    max-width: 300px; 
    margin: 40px auto; 
    background: white; 
    padding: 30px; 
    border-radius: 15px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

/* --- LÖSCHEN BUTTON KORREKTUR --- */
.btn-delete { 
    background-color: #ff4d4d; 
    color: white; 
    text-decoration: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-size: 14px; 
}
.btn-delete:hover { 
    background-color: #cc0000; 
}

/* --- STATISTIK LISTEN KORREKTUR --- */
.card ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0; 
}
.card li { 
    padding: 10px 0; 
    border-bottom: 1px dashed #eee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.card li:last-child { 
    border-bottom: none; 
}


/* --- WÜRFEL-ERGEBNIS BOX --- */
#ergebnis-box { 
    display: none; 
    margin-top: 20px; 
    padding: 20px; 
    background: white; 
    border-radius: 15px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    max-width: 400px; 
    margin-left: auto; 
    margin-right: auto;
    text-align: center;
}
#rezept-bild { max-width: 100%; border-radius: 10px; margin-top: 15px; }
#btn-kochen { margin-top: 20px; background-color: #4caf50; color: white; }
#btn-kochen:disabled { background: #888; cursor: not-allowed; }

/* --- TABELLE (Rezept-Liste) --- */
.table-container { overflow-x: auto; background: white; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
th { background-color: #4caf50; color: white; }
tr:hover { background-color: #f9f9f9; }

/* --- STATISTIK-KARTEN --- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.card h3 { color: #4caf50; border-bottom: 2px solid #eee; padding-bottom: 10px; text-align: left;}
ul.stat-list { list-style-type: none; padding: 0; margin: 0; }
ul.stat-list li { padding: 10px 0; border-bottom: 1px dashed #eee; display: flex; justify-content: space-between; align-items: center;}
ul.stat-list li:last-child { border-bottom: none; }
.badge { background: #ff6b6b; color: white; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; }

/* --- MELDUNGEN (Erfolg / Fehler) --- */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 5px; font-weight: bold; text-align: center; }
.alert-success { background-color: #e8f5e9; color: #2e7d32; border-left: 5px solid #4caf50; }
.alert-danger { background-color: #ffebee; color: #c62828; border-left: 5px solid #ff4d4d; }

/* --- BILDER IN DER LISTE --- */
.rezept-thumb { 
    width: 60px; 
    height: 60px; 
    object-fit: cover; /* Schneidet das Bild quadratisch schön ab */
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- STERNE BEWERTUNG --- */
.stars-outer { 
    position: relative; 
    display: inline-block; 
    color: #e4e4e4; 
    font-size: 20px; 
}
.stars-outer::before { content: "★★★★★"; }

.stars-inner { 
    position: absolute; 
    top: 0; 
    left: 0; 
    white-space: nowrap; 
    overflow: hidden; 
    color: #f8ce0b; /* Goldgelb */
}
.stars-inner::before { content: "★★★★★"; }

.bewertung-text { font-size: 12px; color: #888; margin-top: 5px; display: block; }