/* CSS für das Bohrrechner-Widget */
.bohrrechner-widget-frontend {
    max-width: 100%;
    margin: 60px auto;
    background: var(--bohrrechner-hintergrundfarbe);
    border-radius: var(--bohrrechner-border-radius);
    border: 3px solid var(--bohrrechner-hauptfarbe);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px 32px 32px 32px;
    text-align: center;
    position: relative;
}

.bohrrechner-widget-frontend h3 {
    color: var(--bohrrechner-hauptfarbe);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
}

.bohrrechner-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 18px;
    justify-content: center;
}

.bohrrechner-form-group {
    flex: 1 1 180px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.bohrrechner-form-group label {
    color: var(--bohrrechner-hauptfarbe);
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 1rem;
}

.bohrrechner-form-group select,
.bohrrechner-form-group input[type="number"],
.bohrrechner-form-group input[type="range"] {
    color: var(--bohrrechner-schriftfarbe);
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--bohrrechner-hauptfarbe);
    border-radius: 6px;
    font-size: 1rem;
}

.bohrrechner-add-row {
    color: var(--bohrrechner-hauptfarbe);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: inline-block;
}

.bohrrechner-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 0 0;
    width: 100%;
}

.bohrrechner-calc-btn {
    background: var(--bohrrechner-hintergrundfarbe);
    color: var(--bohrrechner-hauptfarbe);
    border: 2px solid var(--bohrrechner-hauptfarbe);
    border-radius: var(--bohrrechner-border-radius);
    padding: 10px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.bohrrechner-calc-btn:hover {
    background: var(--bohrrechner-hauptfarbe);
    color: var(--bohrrechner-hintergrundfarbe);
}

/* Zentrierte große Box wie im Screenshot */
.bohrrechner-frontend-centerbox {
    max-width: 700px;
    margin: 40px auto 0 auto;
    background: var(--bohrrechner-hintergrundfarbe);
    border-radius: var(--bohrrechner-border-radius);
    border: var(--bohrrechner-border-width, 3px) solid var(--bohrrechner-hauptfarbe);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.10);
    padding: 36px 32px 32px 32px;
    position: relative;
    z-index: 2;
}

.bohrrechner-frontend-headline {
    text-align: center;
    font-size: var(--bohrrechner-font-size-headline, 2rem);
    font-weight: bold;
    color: var(--bohrrechner-hauptfarbe);
    margin-bottom: 18px;
    margin-top: 0;
    letter-spacing: 0.01em;
}

/* Gespeicherte Bohrungen Bereich */
.bohrrechner-saved-list {
    color: var(--bohrrechner-schriftfarbe);
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: var(--bohrrechner-font-size-label, 1rem);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.bohrrechner-saved-list h4 {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--bohrrechner-hauptfarbe);
    font-weight: bold;
}

.bohrrechner-saved-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bohrrechner-saved-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bohrrechner-hauptfarbe);
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: var(--bohrrechner-font-size-label, 1rem);
}

.bohrung-action-btns {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.bohrrechner-saved-list .bohrung-edit-btn {
    color: green;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    cursor: pointer;
    font-size: 1.2em;
}

.bohrrechner-saved-list .bohrung-remove-btn {
    background: none;
    border: none;
    color: var(--bohrrechner-fehlermeldung);
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 10px;
}

/* Formular-Layout wie Screenshot */
.bohrrechner-widget-frontend {
    background: transparent;
    border: none;
    box-shadow: none;
}

.bohrrechner-form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.bohrrechner-form-group {
    flex: 1 1 180px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.bohrrechner-form-group label {
    margin-bottom: 6px;
    font-weight: 500;
}

.bohrrechner-form-group select,
.bohrrechner-form-group input[type="number"],
.bohrrechner-form-group input[type="range"] {
    border-radius: 8px;
    padding: 7px 10px;
    font-size: var(--bohrrechner-font-size-label);
    margin-bottom: 2px;
    background: #fafbfc;
}

.bohrrechner-form-group input[type="range"] {
    width: 100%;
    margin-top: 7px;
}

.bohrrechner-form-group output {
    font-size: 1em;
    color: var(--bohrrechner-hauptfarbe);
    font-weight: bold;
}

.bohrrechner-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    gap: 18px;
}

.bohrrechner-add-bohrung-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 1 1 auto;
}

.bohrrechner-add-row {
    color: var(--bohrrechner-hauptfarbe);
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 0 0 2px;
    transition: color 0.2s;
}

.bohrrechner-add-row:hover {
    color: #d87a00;
    text-decoration: underline;
}

.bohrrechner-calc-btn {
    background: var(--bohrrechner-hauptfarbe);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: var(--bohrrechner-font-size-button, 1.1rem);
    font-weight: bold;
    padding: 12px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    cursor: pointer;
    transition: background 0.2s;
    margin-left: auto;
}

/* Fehlermeldungen wie Labels, boxed */
.bohrrechner-widget-frontend .bohrrechner-error {
    font-size: var(--bohrrechner-font-size-label, 1rem);
    color: var(--bohrrechner-fehlermeldung);
    background: #fff6f6;
    border: 1px solid var(--bohrrechner-fehlermeldung);
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    display: none;
    box-sizing: border-box;
}

/* Range-Input in Hauptfarbe einfärben */
.bohrrechner-widget-frontend input[type="range"] {
    accent-color: var(--bohrrechner-hauptfarbe);
}

.bohrrechner-widget-frontend input[type="range"]::-webkit-slider-thumb {
    background: var(--bohrrechner-hauptfarbe);
}

.bohrrechner-widget-frontend input[type="range"]::-moz-range-thumb {
    background: var(--bohrrechner-hauptfarbe);
}

.bohrrechner-widget-frontend input[type="range"]::-ms-thumb {
    background: var(--bohrrechner-hauptfarbe);
}

@media (max-width: 800px) {
    .bohrrechner-frontend-centerbox {
        padding: 18px 6vw 18px 6vw;
    }

    .bohrrechner-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Mobile Anpassungen für bessere Darstellung */
    .bohrrechner-main-headline {
        font-size: 1.3em !important;
        margin-bottom: 15px !important;
    }
    
    .bohrrechner-bohrung-config h4 {
        font-size: 1em !important;
        margin-bottom: 8px !important;
    }
    
    .bohrrechner-form-group {
        margin-bottom: 12px !important;
    }
    
    .bohrrechner-form-group label {
        font-size: 0.9em !important;
        margin-bottom: 4px !important;
    }
    
    .bohrrechner-form-actions {
        margin-top: 15px !important;
        gap: 8px !important;
    }
}

@media (max-width: 700px) {
    .bohrrechner-widget-frontend {
        padding: 18px 6px;
    }

    .bohrrechner-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Noch kompakteres Design für sehr kleine Bildschirme */
    .bohrrechner-main-headline {
        font-size: 1.2em !important;
        margin-bottom: 12px !important;
    }
    
    .bohrrechner-bohrung-config {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .bohrrechner-bohrung-config h4 {
        font-size: 0.95em !important;
        margin-bottom: 6px !important;
    }
    
    .bohrrechner-form-group {
        margin-bottom: 10px !important;
    }
    
    .bohrrechner-form-group label {
        font-size: 0.85em !important;
        margin-bottom: 3px !important;
    }
    
    .bohrrechner-form-group select,
    .bohrrechner-form-group input {
        font-size: 0.9em !important;
        padding: 6px 8px !important;
    }
    
    .bohrrechner-form-actions {
        margin-top: 12px !important;
        gap: 6px !important;
    }
    
    .bohrrechner-calc-btn,
    .bohrrechner-add-bohrung-btn {
        font-size: 0.95em !important;
        padding: 8px 20px !important;
    }
    
    /* Globale Einstellungen kompakter */
    .bohrrechner-global-settings {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .bohrrechner-global-settings h4 {
        font-size: 0.95em !important;
        margin-bottom: 6px !important;
    }
    
    /* Gespeicherte Bohrungen kompakter */
    #bohrrechner-saved-list {
        margin-bottom: 15px !important;
    }
    
    #bohrrechner-saved-list h4 {
        font-size: 0.95em !important;
        margin-bottom: 8px !important;
    }
    
    /* Offert-Formular kompakter */
    .bohrrechner-offert-form {
        margin-top: 20px !important;
        padding: 20px 0 !important;
    }
    
    .bohrrechner-offert-form-headline {
        font-size: 1em !important;
        margin-bottom: 12px !important;
    }
}

/* Fehlermeldungen wie Labels, boxed */
.bohrrechner-widget-frontend .bohrrechner-error {
    font-size: var(--bohrrechner-font-size-label);
    color: var(--bohrrechner-fehlermeldung);
    background: #fff6f6;
    border: 1px solid var(--bohrrechner-fehlermeldung);
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 4px;
    display: none;
    box-sizing: border-box;
}

/* Neue grüne Klasse für Font Awesome Icons */
.bohrrechner-edit-green,
.bohrung-edit-btn {
    color: green;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
}

/* Kontaktformular Styles */
.bohrrechner-kontakt-label {
    font-size: var(--bohrrechner-font-size-label);
    font-weight: 600;
    color: var(--bohrrechner-hauptfarbe);
    margin-bottom: 6px;
}

.bohrrechner-kontakt-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--bohrrechner-hauptfarbe);
    margin-bottom: 6px;
    font-size: var(--bohrrechner-font-size-label);
}

.bohrrechner-kontakt-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--bohrrechner-font-size-label);
}

.bohrrechner-kontakt-checkbox {
    margin-top: 2px;
}

.bohrrechner-kontakt-btn {
    background: var(--bohrrechner-hauptfarbe);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 32px;
    cursor: pointer;
    text-align: center;
}

.bohrrechner-kontakt-btn:hover {
    background: #d87a00;
}

.bohrrechner-offert-form-headline {
    font-weight: bold;
    color: var(--bohrrechner-hauptfarbe);
    font-size: 1.1em;
    margin-bottom: 18px;
    text-align: center;
}

.bohrrechner-offert-form {
    display: none;
    margin-top: 32px;
    text-align: left;
    width: 100%;
    padding: 28px 0;
}

.bohrrechner-offert-form .bohrrechner-form-actions {
    justify-content: center;
    text-align: center;
}

.bohrrechner-add-bohrung-btn {
    background: var(--bohrrechner-hintergrundfarbe);
    color: var(--bohrrechner-hauptfarbe);
    border: 1px solid var(--bohrrechner-hauptfarbe);
    border-radius: var(--bohrrechner-border-radius);
    padding: 10px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.bohrrechner-cancel-bohrung-link {
    margin-top: 10px !important;
    font-size: 12px !important;
    text-align: right;
}

/* Popup-Styles für Bohrrechner */
.bohrrechner-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.bohrrechner-popup-content {
    position: relative;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bohrrechner-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    z-index: 1000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.bohrrechner-popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Popup-spezifische Widget-Anpassungen */
.bohrrechner-popup-content .bohrrechner-widget-frontend {
    margin: 0;
    border: none;
    box-shadow: none;
    border-radius: 10px;
}

/* Responsive Anpassungen für Popup */
@media (max-width: 768px) {
    .bohrrechner-popup-overlay {
        padding: 10px;
    }
    
    .bohrrechner-popup-content {
        max-height: 95vh;
    }
    
    .bohrrechner-popup-content .bohrrechner-widget-frontend {
        padding: 20px 16px;
    }
}

/* Mobile Optimierungen für kleinere Bildschirme */
@media (max-width: 800px) {

.bohrrechner-form-group {
    flex: 1 1 60px;
}

    /* Widget Container kompakter machen */
    .bohrrechner-widget-frontend {
        padding: 16px !important;
        margin: 10px auto !important;
    }
    
    /* Überschrift stark verkleinern */
    .bohrrechner-widget-frontend h2,
    .bohrrechner-widget-frontend h3,
    .bohrrechner-widget-frontend .elementor-heading-title {
        font-size: 1.1em !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        margin-top: 8px !important;
    }
    
    /* Formular-Gruppen kompakter */
    .bohrrechner-form-group {
        margin-bottom: 4px !important;
        margin-top: 0 !important;
    }
    
    /* Labels kleiner und weniger Abstand */
    .bohrrechner-label {
        font-size: 0.9em !important;
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* Eingabefelder kompakter mit minimalen Abständen */
    .bohrrechner-input,
    .bohrrechner-select {
        padding: 8px !important;
        font-size: 0.9em !important;
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* Spezifische Input-Typen */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* Button kompakter */
    .bohrrechner-btn {
        padding: 10px 20px !important;
        font-size: 0.95em !important;
        margin: 6px 0 !important;
    }
    
    /* Preisliste kompakter */
    .bohrrechner-preisliste {
        margin-top: 8px !important;
        padding: 12px !important;
    }
    
    .bohrrechner-preisliste .bohrrechner-preisliste-item {
        margin-bottom: 6px !important;
        font-size: 0.85em !important;
    }
    
    /* Bohrung Container kompakter */
    .bohrrechner-bohrung {
        margin-bottom: 12px !important;
        padding: 12px !important;
    }
    
    /* Form Actions kompakter */
    .bohrrechner-form-actions {
        margin-top: 12px !important;
        gap: 8px !important;
    }
}

/* Sehr kleine Bildschirme - noch kompakter */
@media (max-width: 600px) {
    /* Widget noch kompakter */
    .bohrrechner-widget-frontend {
        padding: 12px !important;
        margin: 5px auto !important;
    }
    
    /* Überschrift noch kleiner */
    .bohrrechner-widget-frontend h2,
    .bohrrechner-widget-frontend h3,
    .bohrrechner-widget-frontend .elementor-heading-title {
        font-size: 1.0em !important;
        margin-bottom: 8px !important;
        margin-top: 6px !important;
    }
    
    /* Formular-Gruppen minimaler Abstand */
    .bohrrechner-form-group {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* Labels und Inputs noch kleiner mit minimalen Abständen */
    .bohrrechner-label {
        font-size: 0.85em !important;
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
    
    .bohrrechner-input,
    .bohrrechner-select {
        padding: 6px !important;
        font-size: 0.85em !important;
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
    
    /* Spezifische Input-Typen für kleinste Abstände */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
    
    /* Button kompakter */
    .bohrrechner-btn {
        padding: 8px 16px !important;
        font-size: 0.9em !important;
        margin: 4px 0 !important;
    }
    
    /* Bohrung Container minimaler */
    .bohrrechner-bohrung {
        margin-bottom: 8px !important;
        padding: 8px !important;
    }
    
    /* Preisliste minimaler */
    .bohrrechner-preisliste {
        margin-top: 8px !important;
        padding: 8px !important;
    }
    
    .bohrrechner-preisliste .bohrrechner-preisliste-item {
        margin-bottom: 4px !important;
        font-size: 0.8em !important;
    }
}

/* Zusätzliche mobile Optimierungen für alle möglichen CSS-Klassen */
@media (max-width: 800px) {
    /* Elementor spezifische Klassen */
    .elementor-field-group {
        margin-bottom: 4px !important;
    }
    
    .elementor-field {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    .elementor-field-label {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* WordPress Core Klassen */
    .wp-block-group,
    .wp-block-columns {
        margin-bottom: 4px !important;
        margin-top: 0 !important;
    }
    
    /* Allgemeine Input-Container */
    .form-group,
    .field-group,
    .input-group {
        margin-bottom: 4px !important;
        margin-top: 0 !important;
    }
    
    /* Alle Input-Typen */
    input,
    textarea,
    select {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    /* Labels */
    label {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 600px) {
    /* Noch kompakter für sehr kleine Bildschirme */
    .elementor-field-group {
        margin-bottom: 2px !important;
    }
    
    .elementor-field {
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
    
    .elementor-field-label {
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
    
    .form-group,
    .field-group,
    .input-group {
        margin-bottom: 2px !important;
        margin-top: 0 !important;
    }
    
    input,
    textarea,
    select,
    label {
        margin-bottom: 1px !important;
        margin-top: 0 !important;
    }
}