/* public/css/style.css */

/* --- 1. CSS Reset (vereinfacht) --- */

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

/* --- 2. Globale Styles --- */

body {
    font-family: 'Open Sans', sans-serif; /* Moderne, gut lesbare Schrift */
    background-color: #f5f5f5; /* Sehr heller Hintergrund */
    color: #333;
    line-height: 1.6;
}

a {
    color: #3A8C37; /* Link-Farbe (Hauptfarbe) */
    text-decoration: none; /* Keine Unterstreichung standardmäßig */
}

a:hover {
    text-decoration: underline; /* Unterstreichung bei Hover */
}

/* --- 3. Header --- */

header {
    background-color: #3A8C37; /* Hauptfarbe (Grün) */
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#logo {
    height: 40px;
    margin-right: 1rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* --- 4. Kunden-Suchbereich --- */

#kunden-suchen {
    padding: 1rem;
    background-color: white;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative; /* Für absolute Positionierung der Suchergebnisse */
}

#kunden-suchfeld {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s ease-in-out;
}

#kunden-suchfeld:focus {
    border-color: #3A8C37;
    outline: none;
}

#kunden-suchergebnisse {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    display: none; /* Anfangs versteckt */
}

#kunden-suchergebnisse ul {
    list-style: none;
}

#kunden-suchergebnisse li {
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    border-bottom: 1px solid #eee; /* Trennlinie zwischen Ergebnissen */
}

#kunden-suchergebnisse li:last-child {
    border-bottom: none; /* Keine Trennlinie beim letzten Element */
}

#kunden-suchergebnisse li:hover {
    background-color: #e0f0e0; /* Hellgrüner Hintergrund bei Hover (passend zum Header) */
}


/* --- 5. Kunden-Anzeigebereich --- */

#kunden-anzeige {
    background-color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    /* display: none;  <-- Entfernt, da wir die Sichtbarkeit über JS steuern */
}

#kunden-daten {
    margin-bottom: 1rem;
}

#kunden-kontakt {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

#kunden-telefon, #kunden-email {
    margin-right: 1rem;
     display: inline-flex; /* Für die Icons */
    align-items: center;
}

#kunden-telefon a, #kunden-email a {
    color: #333;
    text-decoration: none;
}

#kunden-telefon a:hover, #kunden-email a:hover {
    text-decoration: underline;
}


#kunden-telefon i, #kunden-email i {
    margin-right: 0.5rem;
    color: #3A8C37;
    font-size: 1.2rem;
}

/* --- 6. Buttons --- */
.button{
    display: inline-block;
    background-color: #3A8C37;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.button:hover {
    background-color: #2c6e29;
}

/* --- 7. Weitere Bereiche (Offene Angebote, Historie, Notizen) --- */

#offene-angebote, #historie, #notizen {
    background-color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

#offene-angebote h3,
#historie h3,
#notizen h3 {
    color: #3A8C37;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* --- 8. Footer --- */

footer {
    text-align: center;
    padding: 1rem;
    background-color: #ddd;
    color: #666;
    position: absolute;
    bottom: 0;
     left: 0;
    right: 0;
}

/* --- 9. Responsives Design (Media Queries) --- */

@media (max-width: 768px) {
    #kunden-kontakt {
        flex-direction: column;
        align-items: flex-start; /* Am linken Rand ausrichten */
    }

    #kunden-telefon, #kunden-email {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    .button{
        width: 100%;
    }
     #kunden-daten-bearbeiten-button, #kunde-als-csv-exportieren-button {
        width: 100%;
    }
}

/* --- 10. Dark Mode Toggle --- */
.switch {
  position: relative;
  display: inline-block;
  width: 60px; /* Breite des Schalters */
  height: 30px; /* Höhe des Schalters - angepasst */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 30px; /* stärker abgerundet */
}

/* Das ist der "Knopf" */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;  /* Position angepasst */
    bottom: 2px; /* Position angepasst */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

/* Hier werden die Icons positioniert */
.slider i {
    position: absolute;
    color: white;
    font-size: 1rem; /* Größe angepasst */
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.4s;
}

.slider .fa-sun {
    left: 6px; /* Position angepasst */
    opacity: 1;
}

.slider .fa-moon {
    right: 6px;  /* Position angepasst */
    opacity: 0;
}

/* Zustand, wenn Checkbox gecheckt ist */
input:checked + .slider {
    background-color: #212121;
}

input:checked + .slider:before {
    transform: translateX(30px); /* Knopf nach rechts */
}

input:checked + .slider .fa-sun {
    opacity: 0;
}

input:checked + .slider .fa-moon {
    opacity: 1;
}