/* ========================================
   ALLGEMEINE STYLES
   ======================================== */

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

:root {
    --primary-color: #0088cc;
    --primary-dark: #006699;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-dark: #212529;
    --text-muted: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   BILDSCHIRM-ANSICHT
   ======================================== */

.screen-only {
    display: block;
}

.print-only {
    display: none;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    height: 60px;
    background: white;
    padding: 5px 15px;
    border-radius: 5px;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.calculator-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.calculator-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.input-with-slider {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.input-with-slider input[type="number"] {
    width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.input-with-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--border-color) 0%);
    outline: none;
    -webkit-appearance: none;
}

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

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

.value-display {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Scenario Buttons */
.scenario-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.scenario-btn {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scenario-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.scenario-btn.active {
    border-color: var(--primary-color);
    background: rgba(0, 136, 204, 0.05);
    position: relative;
}

.scenario-btn.active::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.scenario-icon {
    font-size: 2rem;
}

.scenario-name {
    font-weight: 600;
    color: var(--text-dark);
}

.scenario-rate {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Select */
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-secondary {
    background: var(--success-color);
    color: white;
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Results Preview */
.results-preview {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.results-preview h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.preview-card {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.preview-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.preview-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.preview-value.highlight {
    color: var(--success-color);
}

/* ========================================
   DRUCK-ANSICHT
   ======================================== */

@media print {
    /* Verstecke Bildschirm-Elemente */
    .screen-only {
        display: none !important;
    }

    /* Zeige Druck-Elemente */
    .print-only {
        display: block !important;
    }

    /* Seiteneinstellungen */
    @page {
        size: A4 portrait;
        margin: 1.5cm 1.5cm 2cm 1.5cm;
    }

    body {
        background: white;
        color: black;
        font-size: 10pt;
        line-height: 1.4;
    }

    /* Seitenumbrüche */
    .print-page {
        page-break-after: always;
        page-break-inside: avoid;
        min-height: 25cm;
        padding: 0.5cm 0;
    }

    .print-page:last-child {
        page-break-after: auto;
    }

    h2, h3 {
        page-break-after: avoid;
    }

    table {
        page-break-inside: avoid;
    }

    .strategy-box {
        page-break-inside: avoid;
    }

    /* Print Header */
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2cm;
        padding-bottom: 0.5cm;
        border-bottom: 2px solid var(--primary-color);
    }

    .print-logo {
        height: 50px;
        background: white;
    }

    .print-date {
        font-size: 9pt;
        color: var(--text-muted);
    }

    /* Cover Page */
    .page-cover {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .cover-title {
        font-size: 28pt;
        color: var(--primary-color);
        margin-bottom: 0.5cm;
        text-align: center;
    }

    .cover-subtitle {
        font-size: 14pt;
        text-align: center;
        color: var(--text-muted);
        margin-bottom: 2cm;
    }

    .cover-highlight {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        padding: 2cm;
        border-radius: 10px;
        text-align: center;
        margin: 2cm 0;
    }

    .cover-label {
        font-size: 12pt;
        margin-bottom: 0.5cm;
        opacity: 0.9;
    }

    .cover-value {
        font-size: 36pt;
        font-weight: bold;
    }

    .cover-benefits {
        margin-top: 2cm;
    }

    .benefit-item {
        display: flex;
        align-items: center;
        gap: 0.5cm;
        margin-bottom: 0.5cm;
        font-size: 11pt;
    }

    .benefit-icon {
        background: var(--primary-color);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        flex-shrink: 0;
    }

    /* Section Titles */
    .print-section-title {
        color: var(--primary-color);
        font-size: 16pt;
        margin-bottom: 0.5cm;
        padding-bottom: 0.3cm;
        border-bottom: 2px solid var(--primary-color);
    }

    /* Tables */
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 1cm;
    }

    .print-table td {
        padding: 0.3cm;
        border-bottom: 1px solid var(--border-color);
    }

    .table-label {
        font-weight: 600;
        width: 40%;
    }

    .table-value {
        color: var(--primary-color);
        font-weight: 600;
    }

    /* Results Grid */
    .results-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5cm;
        margin-bottom: 1cm;
    }

    .result-box {
        border: 2px solid var(--border-color);
        border-radius: 5px;
        padding: 0.5cm;
        text-align: center;
    }

    .result-label {
        font-size: 9pt;
        color: var(--text-muted);
        margin-bottom: 0.2cm;
    }

    .result-value {
        font-size: 16pt;
        font-weight: bold;
        color: var(--text-dark);
    }

    .result-value.primary {
        color: var(--primary-color);
        font-size: 20pt;
    }

    /* Cost Comparison */
    .cost-comparison {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5cm;
        margin-bottom: 1cm;
    }

    .comparison-column {
        border: 2px solid var(--border-color);
        border-radius: 5px;
        padding: 0.5cm;
    }

    .comparison-column.highlight {
        background: rgba(220, 53, 69, 0.05);
        border-color: var(--danger-color);
    }

    .comparison-title {
        font-size: 12pt;
        margin-bottom: 0.5cm;
        color: var(--primary-color);
    }

    .comparison-column.highlight .comparison-title {
        color: var(--danger-color);
    }

    .comparison-item {
        display: flex;
        justify-content: space-between;
        padding: 0.2cm 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 9pt;
    }

    .comparison-item .value {
        font-weight: 600;
    }

    .comparison-total {
        display: flex;
        justify-content: space-between;
        padding: 0.3cm 0;
        margin-top: 0.3cm;
        border-top: 2px solid var(--text-dark);
        font-weight: bold;
        font-size: 10pt;
    }

    /* Savings Highlight */
    .savings-highlight {
        background: linear-gradient(135deg, var(--success-color), #20c997);
        color: white;
        padding: 0.7cm;
        border-radius: 5px;
        text-align: center;
        margin-bottom: 1cm;
    }

    .savings-label {
        font-size: 10pt;
        margin-bottom: 0.3cm;
    }

    .savings-value {
        font-size: 24pt;
        font-weight: bold;
        margin-bottom: 0.2cm;
    }

    .savings-percent {
        font-size: 12pt;
    }

    /* Chart */
    .chart-container {
        height: 8cm;
        margin-bottom: 1cm;
    }

    /* Detail Table */
    .detail-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8pt;
        margin-bottom: 1cm;
    }

    .detail-table th {
        background: var(--primary-color);
        color: white;
        padding: 0.2cm;
        text-align: left;
        font-weight: 600;
    }

    .detail-table td {
        padding: 0.2cm;
        border-bottom: 1px solid var(--border-color);
    }

    .detail-table tr:nth-child(even) {
        background: rgba(0, 136, 204, 0.05);
    }

    /* Ratgeber */
    .ratgeber-subtitle {
        font-size: 12pt;
        color: var(--primary-color);
        margin-top: 0.7cm;
        margin-bottom: 0.3cm;
    }

    .ratgeber-text {
        font-size: 10pt;
        text-align: justify;
        margin-bottom: 0.5cm;
        line-height: 1.5;
    }

    .comparison-table-ratgeber {
        width: 100%;
        border-collapse: collapse;
        margin: 0.5cm 0;
        font-size: 9pt;
    }

    .comparison-table-ratgeber th {
        background: var(--primary-color);
        color: white;
        padding: 0.3cm;
        text-align: left;
    }

    .comparison-table-ratgeber td {
        padding: 0.3cm;
        border-bottom: 1px solid var(--border-color);
    }

    .info-box-print {
        background: rgba(0, 136, 204, 0.1);
        border-left: 4px solid var(--primary-color);
        padding: 0.5cm;
        margin: 0.5cm 0;
        font-size: 9pt;
    }

    /* Strategy Boxes */
    .strategy-box {
        border: 2px solid var(--border-color);
        border-radius: 5px;
        padding: 0.5cm;
        margin-bottom: 0.5cm;
    }

    .strategy-title {
        font-size: 11pt;
        color: var(--primary-color);
        margin-bottom: 0.3cm;
    }

    .strategy-composition {
        font-size: 9pt;
        margin-bottom: 0.2cm;
        color: var(--text-muted);
    }

    .strategy-details {
        display: flex;
        gap: 1cm;
        font-size: 9pt;
        margin-bottom: 0.3cm;
    }

    .strategy-description {
        font-size: 9pt;
        text-align: justify;
        line-height: 1.4;
    }

    /* Contact Page */
    .page-contact {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .cta-box {
        background: rgba(0, 136, 204, 0.1);
        border: 2px solid var(--primary-color);
        border-radius: 5px;
        padding: 0.7cm;
        margin-bottom: 1cm;
        text-align: center;
    }

    .cta-box h3 {
        color: var(--primary-color);
        margin-bottom: 0.3cm;
        font-size: 14pt;
    }

    .cta-box p {
        font-size: 10pt;
        line-height: 1.5;
    }

    .contact-info h3 {
        font-size: 12pt;
        color: var(--primary-color);
        margin-bottom: 0.5cm;
    }

    .contact-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5cm;
        margin-bottom: 1cm;
    }

    .contact-item {
        padding: 0.4cm;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        font-size: 9pt;
    }

    .contact-item strong {
        display: block;
        color: var(--primary-color);
        margin-bottom: 0.2cm;
    }

    .contact-item a {
        color: var(--primary-color);
        text-decoration: none;
        word-break: break-all;
    }

    .footer-note {
        border-top: 1px solid var(--border-color);
        padding-top: 0.5cm;
        font-size: 8pt;
        color: var(--text-muted);
        text-align: justify;
    }
}

/* Responsive Design für Bildschirm */
@media screen and (max-width: 768px) {
    .scenario-buttons {
        grid-template-columns: 1fr;
    }

    .preview-cards {
        grid-template-columns: 1fr;
    }

    .header .container {
        flex-direction: column;
        text-align: center;
    }
}


/* Szenario-Vergleichstabelle */
.scenario-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

.scenario-comparison-table thead {
    background-color: var(--primary-color);
    color: white;
}

.scenario-comparison-table th,
.scenario-comparison-table td {
    padding: 12px 8px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.scenario-comparison-table th {
    font-weight: 600;
    font-size: 0.85rem;
}

.scenario-comparison-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.scenario-comparison-table tbody tr:hover {
    background-color: #f0f8ff;
}

.scenario-comparison-table .savings-cell {
    color: var(--success-color);
    font-weight: 600;
}

@media print {
    .scenario-comparison-table {
        font-size: 9pt;
        page-break-inside: avoid;
    }
    
    .scenario-comparison-table th,
    .scenario-comparison-table td {
        padding: 8px 6px;
    }
}

/* Kundenname auf Cover-Page */
.cover-customer-name {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
}

.customer-name-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.customer-name-value {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

@media print {
    .cover-customer-name {
        page-break-inside: avoid;
        margin: 0.5cm 0;
        padding: 0.4cm;
        font-size: 10pt;
    }
    
    .customer-name-label {
        font-size: 9pt;
    }
    
    .customer-name-value {
        font-size: 14pt;
    }
}

/* Cover-Page Logo und Header - Print */
@media print {
    .cover-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5cm;
        padding-bottom: 0.5cm;
        border-bottom: 2px solid var(--primary-color);
    }
    
    .cover-logo {
        height: 40px;
        width: auto;
        object-fit: contain;
    }
    
    .cover-date {
        font-size: 10pt;
        color: var(--text-muted);
    }
    
    .cover-result {
        background: rgba(0, 136, 204, 0.1);
        border-left: 4px solid var(--primary-color);
        padding: 0.8cm;
        margin: 1cm 0;
        page-break-inside: avoid;
    }
    
    .cover-result-label {
        font-size: 12pt;
        color: var(--text-muted);
        margin-bottom: 0.3cm;
    }
    
    .cover-result-value {
        font-size: 28pt;
        font-weight: bold;
        color: var(--primary-color);
    }
}

/* Cover-Page Logo und Header - Print */
@media print {
    .cover-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5cm;
        padding-bottom: 0.5cm;
        border-bottom: 2px solid var(--primary-color);
    }
    
    .cover-logo {
        height: 40px !important;
        width: auto !important;
        object-fit: contain;
    }
    
    .cover-date {
        font-size: 10pt;
        color: var(--text-muted);
    }
    
    .cover-result {
        background: rgba(0, 136, 204, 0.1);
        border-left: 4px solid var(--primary-color);
        padding: 0.8cm;
        margin: 1cm 0;
        page-break-inside: avoid;
    }
    
    .cover-result-label {
        font-size: 12pt;
        color: var(--text-muted);
        margin-bottom: 0.3cm;
    }
    
    .cover-result-value {
        font-size: 28pt;
        font-weight: bold;
        color: var(--primary-color);
    }
}
