/* ===== GLOBALE VARIABEN ===== */
:root {
    --primary: #648FA8;           /* Primärfarbe für Buttons, Header (index.html: card-header) */
    --primary-dark: #0F3857;      /* Dunklere Primärfarbe für Verläufe */
    --success: #1A5A7F;           /* Erfolgsfarbe für Hauptleistung (index.html: .bg-success) */
    --success-light: #FEFAF6;     /* Helle Erfolgsfarbe für Hintergründe */
    --warning: #648FA8;           /* Warnfarbe für Zusatzleistungen (index.html: Zusätze für die Einlagen) */
    --info: #5A6B79;              /* Infofarbe für Info-Buttons (index.html: .info-button-rect) */
    --light-bg: #0F2D3F;          /* Hintergrundfarbe der Seite (index.html: body) */
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4); /* Schatten für Karten (index.html: .card) */
    --header-gradient: linear-gradient(135deg, #1F4A63 0%, #5B8CA3 50%, #D4B493 100%); /* Header-Verlauf (index.html: header) */
}

/* ===== GLOBALE STYLES ===== */
/* index.html: body */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    padding-bottom: 40px;
    line-height: 1.6;
    color: #4b5769;
    -webkit-text-size-adjust: 100%; /* Verhindert Text-Zoom auf iOS */
}

/* index.html: .container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== MODERNER HEADER ===== */
/* index.html: header */
header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.2rem 0;
    background: var(--header-gradient);
    border-radius: 12px;
    margin-top: 0.5rem;
    color:  #FDFBF7;
}

/* index.html: header h1 */
header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: white;
    word-wrap: break-word;
}

/* index.html: header p.text-light */
header p.text-light {
    color: #FDFBF7;
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

/* index.html: header p.text-light.small */
header p.text-light.small {
    color: #FDFBF7; 
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* ===== MODERNE KARTEN ===== */
/* index.html: .card */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.2rem;
    overflow: hidden;
    transition: transform 0.2s ease;
}

/* index.html: .card hover Effekt */
.card:hover {
    transform: translateY(-2px);
}

/* index.html: .card-header */
.card-header {
    background: linear-gradient(135deg, #1F4A63 0%, #5B8CA3 100%);
    color: white; 
    border: none;
    padding: 0.8rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
}

/* index.html: .card-header.bg-success (Empfohlene Einlagenversorgung) */
.card-header.bg-success {
    background: linear-gradient(135deg, #1F4A63 0%, #5B8CA3 100%);
}

/* index.html: .card-header.bg-primary (Versorgungsvorschlag) */
.card-header.bg-primary {
    background: linear-gradient(135deg, #A98B6C 0%, #D4B493 100%);
    color: white;
}

/* ===== MODERNE DIAGNOSE LISTE ===== */
/* index.html: #diagnosis-list */
.diagnosis-checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling auf iOS */
}

/* index.html: .diagnosis-item */
.diagnosis-item {
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #F9F5F1 0%, #FDFBF7 100%);
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

/* index.html: .diagnosis-item hover Effekt */
.diagnosis-item:hover {
    background: #f9fafb;
    border-color: var(--primary);
}


/* ===== MODERNE PRODUKTKARTEN ===== */
/* index.html: .product-card (Basis für alle Produktkarten) */
.product-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* index.html: .product-card.main (Hauptleistung - #main-product) */
.product-card.main {
    border-left-color: var(--success);
    background: linear-gradient(135deg, #FDFBF7 0%, #FDFDFC 100%);
}

/* index.html: .product-card.addon (Zusatzleistungen - #addon-products) */
.product-card.addon {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, #FDFBF7 0%, #FDFDFC 100%);
}

/* index.html: .product-card.disabled (Deaktivierte Zusatzleistungen) */
.product-card.disabled {
    opacity: 0.6;
    background-color: linear-gradient(135deg, #FDFBF7 0%, #FDFDFC 100%);
}

/* ===== MODERNE BUTTONS ===== */
/* index.html: .btn (Basis für alle Buttons) */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
}

/* index.html: .btn-outline-light (#refresh-button) */
.btn-outline-light {
    background-color: transparent; /* Hintergrund ist transparent */
    border: 2px solid #FDFBF7;   /* Heller Rahmen in Vanilla Cream */
    color: #FDFBF7;              /* Helle Schriftfarbe */
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
}

/* index.html: .btn-outline-light hover Effekt */
.btn-outline-light:hover {
    background-color: #FDFBF7;  /* Im Hover füllt sich der Button mit Vanilla Cream */
    color: #0F2D3F;              /* Text wird dunkel (Midnight Sapphire) für besten Kontrast */
    border-color: #FDFBF7;
}

/* ===== INFO BUTTONS ===== */
/* index.html: .info-button-rect (Info-Buttons bei Diagnosen und Produkten) */
.info-button-rect {
    width: 18px;
    height: 18px;
    background: #959ca1;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 0;
    transition: all 0.2s ease;
}

/* index.html: .info-button-rect hover Effekt */
.info-button-rect:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px #D4DEE3;
}

/* ===== MODERNE FORMULARELEMENTE ===== */
/* index.html: #diagnosis-search */
.form-control {
    border-radius: 8px;
    border: 2px solid #c7d6dd;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
}

/* index.html: #diagnosis-search focus Zustand */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
}

/* index.html: .form-check-input (Diagnose-Checkboxen) */
.form-check-input {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #c7d6dd;
    margin-right: 0.4rem;
}

/* index.html: .form-check-input checked Zustand */
.form-check-input:checked {
    background-color: var(--success);
    border-color: var(--success);
}

/* index.html: .addon-checkbox (Zusatzleistungs-Checkboxen) */
.addon-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid #cbd1d6;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    position: relative;
}

/* index.html: .addon-checkbox checked Zustand */
.addon-checkbox:checked {
    background-color: var(--success);
    border-color: var(--success);
}

/* index.html: .addon-checkbox Haken-Symbol when checked */
.addon-checkbox:checked::after {
    content: "✓";
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: bold;
}

/* ===== TYPOGRAPHIE OPTIMIERUNG FÜR MOBILE ===== */
/* index.html: Alle Textelemente */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    hyphens: auto;
}

/* index.html: Lange Überschriften speziell für mobile */
.card-header h5 {
    font-size: 0.95rem;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
}

/* index.html: Produktnamen in Karten */
.product-card h6 {
    font-size: 0.9rem;
    line-height: 1.3;
    word-wrap: break-word;
}

/* index.html: Versorgungsvorschlag Text */
#price-calculation {
    font-size: 0.9rem;
}

#price-calculation .fw-bold {
    font-size: 0.95rem;
}

/* ===== RESPONSIVES DESIGN ===== */
/* index.html: Responsive Anpassungen für mobile Geräte */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    header {
        padding: 1rem 0;
        margin-bottom: 1.2rem;
        border-radius: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .product-card {
        padding: 0.8rem;
        border-radius: 8px;
    }
    
    .product-card h6 {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }
    
    .btn-outline-light {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Spezielle Anpassungen für sehr kleine Displays */
    @media (max-width: 360px) {
        header h1 {
            font-size: 1.3rem;
        }
        
        header p.text-light {
            font-size: 0.85rem;
        }
        
        .card-header h5 {
            font-size: 0.85rem;
        }
        
        /* Lange Überschriften speziell behandeln */
        .card-header h5.mb-0 {
            font-size: 0.82rem;
            line-height: 1.2;
        }
    }
}

/* ===== IPHONE SPEZIFISCHE OPTIMIERUNGEN ===== */
@supports (-webkit-touch-callout: none) {
    /* iOS spezifische Anpassungen */
    .diagnosis-checkbox-list {
        padding-bottom: 2rem; /* Extra Platz für iOS Browser UI */
    }
    
    .form-control {
        font-size: 16px; /* Verhindert Zoom auf iOS beim Fokus */
    }
    
    /* Smooth scrolling für iOS */
    .diagnosis-checkbox-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== SICHERSTELLUNG DASS LANGE TEXTE UMBRECHEN ===== */
/* index.html: Lange Produktnamen und Überschriften */
.product-card h6.fw-bold,
.card-header h5.mb-0 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Speziell für die langen Überschriften */
.card-header.bg-success h5.mb-0,
.card-header.bg-primary h5.mb-0 {
    font-size: 0.9rem;
    line-height: 1.25;
}

@media (max-width: 768px) {
    .card-header.bg-success h5.mb-0,
    .card-header.bg-primary h5.mb-0 {
        font-size: 0.85rem;
        line-height: 1.2;
    }
}

.text-muted {
    font-size: .875em;
}

.mt-2 {
    font-size: .875em;
}

.card-body {
    background: #FDFBF7;
}