/**
 * Dezibel-Rechner Tool Styles
 * Nutzt CSS-Variablen aus style.css für Konsistenz
 */

.db-rechner {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Einzelnes Rechner-Modul */
.db-modul {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.db-modul h3 {
    margin: 0 0 1rem 0;
    font-size: var(--h3-size);
    color: var(--text);
}

/* Input-Gruppen */
.db-input-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.db-input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 140px;
}

.db-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
}

.db-input-group input[type="number"],
.db-input-group input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: white;
    color: var(--text);
    transition: border-color 0.2s;
}

.db-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.db-input-group .db-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Richtungspfeil zwischen bidirektionalen Inputs */
.db-direction {
    display: flex;
    align-items: center;
    padding-bottom: 0.2rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Ergebnis-Anzeige */
.db-result {
    background: var(--bg-highlight, #f0f7ff);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
}

.db-result-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.db-result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.db-result-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Formel-Anzeige */
.db-formel {
    background: var(--bg-hover, #f8f9fa);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Kaskade/Kette */
.db-kette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.db-kette-glied {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-hover, #f8f9fa);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.6rem;
}

.db-kette-glied input[type="text"] {
    width: 80px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.db-kette-glied input[type="number"] {
    width: 65px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: right;
    background: white;
}

.db-kette-glied input:focus {
    outline: none;
    border-color: var(--primary);
}

.db-kette-glied .db-kette-db {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.db-kette-glied .db-kette-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 0.2rem;
    line-height: 1;
}

.db-kette-glied .db-kette-remove:hover {
    color: #e53e3e;
}

.db-kette-pfeil {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.db-kette-add {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
}

.db-kette-add:hover {
    background: var(--bg-hover, #f8f9fa);
    border-color: var(--primary);
}

/* Slider-Modul */
.db-slider-container {
    margin: 1rem 0;
}

.db-slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.db-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.db-slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.db-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.db-slider-display {
    text-align: center;
    margin-top: 0.75rem;
}

.db-slider-db {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.db-slider-faktor {
    font-size: 1.1rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.db-slider-merksatz {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .db-input-row {
        gap: 0.5rem;
    }

    .db-input-group {
        min-width: 100px;
    }

    .db-input-group label {
        font-size: 0.8rem;
    }

    .db-input-group input[type="number"],
    .db-input-group input[type="text"] {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }

    .db-direction {
        font-size: 1rem;
        padding: 0 0.1rem;
    }

    .db-kette {
        flex-direction: column;
        align-items: stretch;
    }

    .db-kette-pfeil {
        transform: rotate(90deg);
        align-self: center;
    }

    .db-kette-glied {
        flex-wrap: wrap;
    }

    .db-kette-glied input[type="text"] {
        width: 100%;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .db-modul {
        padding: 1rem;
    }

    .db-modul h3 {
        font-size: 1.1rem;
    }

    .db-result-value {
        font-size: 1.1rem;
    }

    .db-slider-db {
        font-size: 1.25rem;
    }
}
