/* Thrive Themes Kompatibilität - sehr hohe Spezifität */
.roi-rechner-container,
.roi-rechner-container *,
.roi-rechner-container *::before,
.roi-rechner-container *::after {
    box-sizing: border-box !important;
    /* Verhindere content-box von Thrive Themes */
}

/* Abstände oben und unten für den ROI Rechner */
.roi-rechner-container {
    margin-top: 5px !important;
    margin-bottom: 20px !important;
}

/* Spezifische Thrive Wrapper Überschreibung */
.thrv_wrapper .roi-rechner-container,
.thrv_wrapper .roi-rechner-container *,
.thrv_wrapper .roi-rechner-container *::before,
.thrv_wrapper .roi-rechner-container *::after {
    box-sizing: border-box !important;
}

/* Standard Reset für ROI Rechner */
.roi-rechner-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #0e2a3f;
}

/* Höhere Spezifität für Container-Breite */
.roi-rechner-container .container,
.roi-rechner-container div.container,
div.roi-rechner-container .container {
    max-width: none !important;
    width: 100% !important;
    
    box-sizing: border-box !important;
}

.header {
    background: linear-gradient(135deg, #2A6F97 0%, #00a896 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 168, 150, 0.2);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.progress-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.progress-step {
    text-align: center;
    flex: 1;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: -1;
}

.progress-step.completed:not(:last-child)::after {
    background: #2A6F97;
}

.progress-number {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    color: #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 10px;
    position: relative;
    z-index: 1;
}

.progress-step.active .progress-number {
    background: #2A6F97;
    color: white;
    box-shadow: 0 0 0 8px rgba(42, 111, 151, 0.2);
}

.progress-step.completed .progress-number {
    background: #00a896;
    color: white;
}

.progress-label {
    font-size: 0.85em;
    color: #666;
}

.step {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: none;
    min-height: 400px;
}

.step.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 1.8em;
    font-weight: 600;
    color: #0e2a3f;
    margin-bottom: 30px;
}

.explanation {
    background: #f0f7f7;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    font-size: 1.05em;
    line-height: 1.6;
}

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.input-label {
    flex: 1;
    min-width: 250px;
    font-weight: 500;
    font-size: 1.1em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="number"] {
    width: 180px;
    padding: 15px 100px 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    color: #0e2a3f;
}

input[type="number"]:focus {
    outline: none;
    border-color: #2A6F97;
    box-shadow: 0 0 0 3px rgba(42, 111, 151, 0.1);
}

input.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Validation Tooltips */
.validation-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.validation-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #dc3545;
}

.validation-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.unit {
    position: absolute;
    right: 20px;
    color: #6c757d;
    font-weight: 500;
    pointer-events: none;
}

.equals {
    margin: 0 15px;
    font-size: 1.3em;
    color: #6c757d;
}

.result-inline {
    font-size: 1.4em;
    font-weight: 700;
    color: #2A6F97;
    min-width: 120px;
}

.example {
    background: #E9F1F5;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 0.95em;
    font-style: italic;
}

.help-button {
    background: #00a896;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.help-button:hover {
    background: #008778;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 150, 0.3);
}

.help-content {
    display: none;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.95em;
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

/* Show-Klasse hat höhere Spezifität - mehrfach für WordPress/Thrive */
.help-content.show {
    display: block !important;
}

.roi-rechner-container .help-content.show {
    display: block !important;
}

.thrv_wrapper .roi-rechner-container .help-content.show {
    display: block !important;
}

/* Debug-Regel um zu testen */
.help-content.show {
    background: yellow !important;
    border: 3px solid red !important;
    display: block !important;
}

.clv-calculator {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #2A6F97;
}

.clv-input-group {
    margin-bottom: 15px;
}

.clv-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.clv-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
}

.clv-button {
    background: #2A6F97;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.clv-button:hover {
    background: #0e2a3f;
}

.clv-button-success {
    background-color: #00a896;
}

.clv-button-success:hover {
    background-color: #008778;
}

.clv-result {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #e9f5f5;
    border-radius: 8px;
    text-align: center;
}

.navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #e9ecef;
}

.nav-button {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-button.prev {
    background: #e9ecef;
    color: #495057;
}

.nav-button.prev:hover {
    background: #dee2e6;
}

.nav-button.next,
.nav-button.finish {
    background: #2A6F97;
    color: white;
}

.nav-button.next:hover,
.nav-button.finish:hover {
    background: #00a896;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 150, 0.3);
}

.nav-button:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.warning {
    display: none;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 0.95em;
}

.clv-tabs {
    display: flex;
    margin-bottom: 0;
}

.clv-tab {
    flex: 1;
    padding: 15px;
    font-size: 1em;
    text-align: center;
    cursor: pointer;
    background: #e9ecef;
    border: none;
    border-bottom: 2px solid #dee2e6;
    transition: all 0.3s ease;
    border-radius: 10px 10px 0 0;
}

.clv-tab.active {
    background: #f8f9fa;
    border-bottom-color: #2A6F97;
    font-weight: 600;
}

.clv-content {
    display: none;
}

.clv-content.active {
    display: block;
}

#result-calculator {
    padding: 20px;
    background: #f0f7f7;
    border-radius: 15px;
}

#result-calculator h3 {
    font-size: 1.6em;
    text-align: center;
    color: #0e2a3f;
    margin-bottom: 30px;
}

.performance-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.performance-button {
    flex: 1;
    padding: 15px;
    font-size: 1em;
    border: 2px solid #adb5bd;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.performance-button.active,
.performance-button:hover {
    background: #2A6F97;
    color: white;
    border-color: #2A6F97;
    transform: scale(1.05);
}

.result-inputs {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.result-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-input-row:not(:last-child) {
    margin-bottom: 15px;
}

.result-input-row label {
    font-weight: 500;
}

.result-input-row .input-wrapper {
    width: auto;
}

.result-input-row input {
    width: 140px;
    padding-right: 40px;
}

.result-input-row .unit {
    right: 15px;
}

.reality-check-area {
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px solid;
    text-align: center;
    transition: all 0.3s ease;
}

.reality-check-area.profitabel {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.reality-check-area.unprofitabel {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.reality-check-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 15px;
}

.reality-check-title.profitabel {
    color: #155724;
}

.reality-check-title.unprofitabel {
    color: #721c24;
}

#result-details,
#monthly-planner-results {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

#result-details h4,
#monthly-planner-results h4 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #0e2a3f;
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    font-weight: 500;
}

.detail-item .value {
    font-size: 1.2em;
    font-weight: 600;
    color: #00a896;
}

.roi-slider {
    width: calc(100% - 30px);
    margin: 0 10px 0 10px;
    margin-right: 20px;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    outline: none;
    transition: opacity 0.2s;
}

.roi-slider:hover {
    opacity: 1;
}

.roi-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #2A6F97;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.roi-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #2A6F97;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Info Icons - styled similar to validation tooltips */
.info-icon {
    display: inline-block;
    position: relative;
    margin-left: 5px;
    font-size: 0.9em;
    color: #6c757d;
    cursor: help;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.info-icon:hover {
    opacity: 1;
    color: #2A6F97;
}

.info-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #2A6F97;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(42, 111, 151, 0.3);
    max-width: 300px;
    white-space: normal;
    text-align: left;
}

.info-icon:hover::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2A6F97;
    z-index: 1001;
}

.performance-button .info-icon {
    margin-left: 8px;
    font-size: 0.8em;
}

/* Remove default title attribute tooltip */
.info-icon[title] {
    position: relative;
}

.info-icon[title]:hover::after {
    content: attr(title);
}


/* Scenario History */
.scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.scenario-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scenario-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: center;
}

.scenario-label {
    font-weight: 600;
    color: #0e2a3f;
    font-size: 1.1em;
}

.scenario-details {
    font-size: 0.9em;
    color: #495057;
}

.scenario-result {
    text-align: right;
    font-weight: 600;
    color: #00a896;
}

.scenario-actions {
    display: flex;
    gap: 5px;
    margin-left: 15px;
}

.scenario-action-btn {
    padding: 8px 12px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-load-btn {
    background: #2A6F97;
    color: white;
}

.scenario-load-btn:hover {
    background: #0e2a3f;
}

.scenario-delete-btn {
    background: #dc3545;
    color: white;
}

.scenario-delete-btn:hover {
    background: #c82333;
}

.scenario-timestamp {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 3px;
}

/* Kachel-Design für Modus-Auswahl */
.mode-selector-container {
    display: flex;
    gap: 30px;
    margin: 40px 0;
    justify-content: center;
}

.mode-card {
    width: 280px;
    padding: 25px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: #adb5bd;
}

.mode-card.active {
    border-color: #2A6F97;
    box-shadow: 0 8px 20px rgba(42, 111, 151, 0.2);
    transform: translateY(-5px);
    background-color: #f8f9fa;
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    line-height: 1;
}

.mode-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #0e2a3f;
}

.mode-card p {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.5;
}

/* Thrive Themes Mobile-spezifische Fixes */
.roi-rechner-container .nav-button,
.roi-rechner-container .help-button,
.roi-rechner-container .clv-button {
    box-sizing: border-box !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Verhindere Button-Overflow in Thrive Themes */
.thrv_wrapper .roi-rechner-container .navigation {
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.thrv_wrapper .roi-rechner-container .navigation .nav-button {
    box-sizing: border-box !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
}

/* ----- Mobile Responsiveness ----- */
@media (max-width: 820px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 0;
    }

    .header {
        padding: 20px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }

    .step {
        padding: 20px;
    }

    .step-title {
        font-size: 1.5em;
    }

    .progress-label {
        display: none;
    }
    
    .progress-number {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    .progress-step:not(:last-child)::after {
        top: 17px;
    }

    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 25px;
    }

    .input-label {
        min-width: unset;
        width: 100%;
        font-size: 1em;
    }

    .input-wrapper {
        width: 100%;
    }

    input[type="number"] {
        width: 100%;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    
    .mode-selector-container {
        flex-direction: column;
        gap: 15px;
        margin: 20px 0;
    }

    .mode-card {
        width: 100%;
    }

    #step-3-summary {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    #step-3-summary > div:last-child { /* The chart container */
        flex-basis: auto !important;
        width: 100%;
        max-width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    #cr-content-absolute .clv-input-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    #cr-content-absolute .clv-label {
        display: block !important;
        width: auto !important;
        text-align: left !important;
        margin-right: 0 !important;
        margin-bottom: 5px;
    }

    #cr-content-absolute .clv-input {
        width: 100%;
    }
    
    .performance-selector {
        flex-direction: column;
    }

    .result-input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-input-row .input-wrapper {
        width: 100%;
    }

    .result-input-row input {
        width: 100%;
    }
    
    .navigation {
        flex-direction: column-reverse;
        gap: 15px;
    }

    .nav-button {
        width: 100%;
        text-align: center;
    }
    
    .navigation > button {
        margin-top: 0 !important;
    }
    
    #realityCheckArea .chart-container {
        height: 150px !important;
    }

    /* Mobile Chart Improvements */
    .validation-tooltip {
        left: 50%;
        transform: translateX(-50%) translateY(-5px);
        white-space: normal;
        max-width: 280px;
        text-align: center;
    }

    .validation-tooltip.show {
        transform: translateX(-50%) translateY(0);
    }

    .validation-tooltip::before {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Better spacing on mobile */
    .clv-calculator {
        margin: 10px 0;
        padding: 15px;
    }

    .help-content {
        padding: 15px;
        font-size: 0.9em;
    }

    /* Chart specific mobile improvements */
    #revenuePieChart,
    #cpaComparisonChart {
        min-height: 150px;
    }

    /* Results page navigation buttons - stack vertically on mobile */
    .navigation[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    /* Thrive Themes Mobile-spezifische Überschreibungen */
    .thrv_wrapper .roi-rechner-container .nav-button {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 8px !important;
        font-size: 0.9em !important;
        text-align: center !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .thrv_wrapper .roi-rechner-container .navigation {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Input-Felder auf Mobile in Thrive Themes */
    .thrv_wrapper .roi-rechner-container input[type="number"],
    .thrv_wrapper .roi-rechner-container .input-wrapper {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}
