/*
 * MWST Rechner Styles
 * Version: 1.0.0
 * Author: Dein Name
 */

/* Basis-Container */
.mwst-rechner-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    max-width: 400px;
    margin: 30px auto; /* Zentrierung */
    color: #333;
    box-sizing: border-box; /* Wichtig für konsistente Box-Modell-Berechnung */
}

/* Header und Toggle-Buttons */
.mwst-rechner-header {
    margin-bottom: 25px;
    text-align: center;
}

.mwst-rechner-toggle {
    display: inline-flex;
    background-color: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    padding: 4px;
}

.mwst-rechner-toggle input[type="radio"] {
    display: none; /* Versteckt die Standard-Radio-Buttons */
}

.mwst-rechner-toggle label {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 6px;
    user-select: none; /* Text nicht markierbar */
    position: relative;
    z-index: 1; /* Stellt sicher, dass der Text über dem Hintergrund liegt */
}

/* Stil für den aktiven Toggle-Button */
.mwst-rechner-toggle input[type="radio"]:checked + label {
    background-color: #007bff; /* Primärfarbe */
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Styling für Hover-Effekt (nicht aktive Buttons) */
.mwst-rechner-toggle input[type="radio"]:not(:checked) + label:hover {
    background-color: #e2e6ea;
}

/* Eingabefelder (Betrag, Individueller Steuersatz) */
.mwst-rechner-input-group {
    margin-bottom: 25px;
}

.mwst-rechner-input-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.mwst-rechner-input-wrapper {
    position: relative;
}

.mwst-rechner-input-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 40px 12px 15px; /* Platz für Symbole */
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -moz-appearance: textfield; /* Firefox: Entfernt Pfeile */
}

.mwst-rechner-input-wrapper input[type="text"]::-webkit-outer-spin-button,
.mwst-rechner-input-wrapper input[type="text"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge: Entfernt Pfeile */
    margin: 0;
}

.mwst-rechner-input-wrapper input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Platzierung der Symbole in den Eingabefeldern */
.mwst-rechner-currency-symbol,
.mwst-rechner-percent-symbol {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
    pointer-events: none; /* Symbole sollen nicht klickbar sein */
}

/* Steuersatz-Gruppe und Optionen */
.mwst-rechner-tax-rates-group {
    margin-bottom: 25px; /* Abstand zur nächsten Sektion */
}

.mwst-rechner-tax-rates-group > .mwst-rechner-label { /* Label "Mehrwertsteuersatz:" */
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.mwst-rechner-tax-options {
    display: flex; /* Für die 3 Buttons nebeneinander */
    gap: 10px; /* Abstand zwischen den Buttons */
    margin-bottom: 10px; /* Abstand zum potenziellen Inputfeld */
}

.mwst-rechner-tax-rate-option {
    flex: 1; /* Gleichmäßige Breite für alle drei Optionen */
}

.mwst-rechner-tax-rate-option input[type="radio"] {
    display: none;
}

.mwst-rechner-tax-rate-option label {
    display: block;
    text-align: center;
    padding: 12px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, font-weight 0.2s ease;
    user-select: none;
    height: 100%; /* Sicherstellen, dass alle Labels gleiche Höhe haben */
    display: flex; /* Für interne Ausrichtung */
    align-items: center; /* Zentriert vertikal */
    justify-content: center; /* Zentriert horizontal (wenn kein Input drin ist) */
}

/* Stil für den aktiven Steuersatz-Button (7% / 19%) */
.mwst-rechner-tax-rate-option:not(.mwst-rechner-individual-tax) input[type="radio"]:checked + label {
    background-color: #e6f2ff; /* Leichte Hintergrundfarbe für aktiv */
    border-color: #007bff;
    color: #007bff; /* Primärfarbe für Text */
    font-weight: 600;
}

/* Stil für den aktiven individuellen Steuersatz-Button */
.mwst-rechner-tax-rate-option.mwst-rechner-individual-tax input[type="radio"]:checked + label {
    background-color: #333; /* Dunklerer Hintergrund, wie im Screenshot */
    border-color: #333;
    color: #fff;
    font-weight: 600;
}


/* Hover-Effekt für Steuersatz-Buttons */
.mwst-rechner-tax-rate-option label:hover {
    border-color: #b3d9ff;
    font-weight: bold; /* Nur Text fett, Farbe bleibt */
}
/* Spezieller Hover für individuellen Button, wenn NICHT aktiv */
.mwst-rechner-tax-rate-option.mwst-rechner-individual-tax input[type="radio"]:not(:checked) + label:hover {
    border-color: #666; /* Etwas dunklerer Rand beim Hover, wenn nicht aktiv */
    color: #333; /* Textfarbe dunkler */
}


/* Individuelle Steuersatz Input Zeile */
.mwst-rechner-individual-input-row {
    margin-top: 10px; /* Abstand zu den Buttons */
    transition: all 0.3s ease-out; /* Sanfter Übergang beim Ein-/Ausblenden */
    overflow: hidden; /* Wichtig für die Höhe-Transition */
    max-height: 0; /* Initial 0 Höhe, wird per JS gesetzt */
    opacity: 0; /* Initial unsichtbar */
}

.mwst-rechner-individual-input-row.show-input {
    max-height: 100px; /* **WICHTIG:** Erhöhte Höhe, um sicherzustellen, dass das Feld sichtbar ist */
    opacity: 1;
}

.mwst-rechner-individual-input-row .mwst-rechner-input-wrapper {
    margin-bottom: 30px;
}

.mwst-rechner-individual-input-row .mwst-rechner-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 15px; /* Etwas kleineres Padding als Hauptbetrag */
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 18px; /* Etwas kleinere Schrift als Hauptbetrag */
    font-weight: 500;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.mwst-rechner-individual-input-row .mwst-rechner-input-wrapper input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

.mwst-rechner-individual-input-row .mwst-rechner-percent-symbol {
    font-size: 16px; /* Angepasste Größe */
    right: 15px; /* Angepasste Position */
}

/* Ergebnisbereich */
.mwst-rechner-results {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Abstand zwischen den Ergebniszeilen */
    position: relative; /* Für die Kopier-Nachricht (nicht mehr relevant mit fixed position) */
}

.mwst-rechner-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    position: relative; /* Für den Kopier-Button */
}

.mwst-rechner-result-item:last-child {
    border-bottom: none; /* Kein Strich beim letzten Element */
}

.mwst-rechner-label {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.mwst-rechner-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    flex-grow: 1; /* Lässt den Wert den Raum einnehmen */
    text-align: right; /* Rechtsbündig ausrichten */
    margin-right: 10px; /* Abstand zum Button */
}

/* Hervorhebung des Hauptergebnisses */
.mwst-rechner-result-item.highlighted .mwst-rechner-label,
.mwst-rechner-result-item.highlighted .mwst-rechner-value {
    color: #007bff; /* Primärfarbe für Hervorhebung */
    font-weight: 700;
    font-size: 24px; /* Größerer Font für Hervorhebung */
}

/* Kopier-Button */
.mwst-rechner-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 18px; /* Oder Icon-Größe anpassen */
    padding: 5px;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 44px; /* 44px für Kreis bei 18px Icon + 5px Padding */
    display: flex; /* Für Icon-Zentrierung */
    align-items: center;
    justify-content: center;
}

.mwst-rechner-copy:hover {
    color: #007bff;
    background-color: #e6f2ff;
}

/* Kopier-Icon (beispielhaft mit Font Awesome oder SVG) */
.mwst-rechner-copy::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23aaa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>');
    display: inline-block;
    vertical-align: middle;
    /* Optional: Anpassen der Farbe des Icons beim Hover */
    transition: stroke 0.2s ease;
}

.mwst-rechner-copy:hover::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>');
}


/* Styles für die dynamisch erzeugte Kopier-Erfolgsmeldung */
.mwst-rechner-toast-message {
    position: fixed; /* Fixiert im Viewport, immer sichtbar */
    bottom: 20px; /* Abstand vom unteren Rand */
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745; /* Grün für Erfolg */
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999; /* Sehr hoher Z-Index, um immer oben zu sein */
    opacity: 0;
    pointer-events: none; /* Macht die Meldung nicht klickbar und lässt Interaktion mit Elementen darunter zu */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.mwst-rechner-toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px); /* Leicht nach oben bewegen beim Einblenden */
}

/* Fehlermeldungen (werden später mit JS manipuliert) */
.mwst-rechner-error-message {
    color: #dc3545; /* Rot für Fehler */
    font-size: 13px;
    margin-top: 5px;
    margin-bottom: 15px;
    /*display: none;*/ /* Initial versteckt, aber JS steuert es */
    text-align: center;
}

/* Responsive Anpassungen */
@media (max-width: 600px) {
    .mwst-rechner-container {
        padding: 20px;
        margin: 15px auto;
        border-radius: 8px;
    }

    .mwst-rechner-toggle label {
        padding: 8px 15px;
        font-size: 14px;
    }

    .mwst-rechner-tax-options { /* Für die Buttons, um sich anzupassen */
        flex-direction: column; /* Stapelt die Optionen vertikal auf kleinen Bildschirmen */
        gap: 5px; /* Weniger Abstand beim Stapeln */
    }

    .mwst-rechner-tax-rate-option {
        width: 100%; /* Volle Breite auf kleinen Bildschirmen */
        margin-bottom: 0; /* Abstand wird durch gap geregelt */
    }

    .mwst-rechner-input-wrapper input[type="text"] {
        font-size: 18px;
    }

    .mwst-rechner-value {
        font-size: 18px;
    }

    .mwst-rechner-result-item.highlighted .mwst-rechner-value {
        font-size: 22px;
    }

    /* Individueller Wert auf Mobilgeräten - bleibt vertikal gestapelt, da flex-direction: column */
}