/* ==========================================================================
   GO-MEDICAL ELITE DARK DESIGN - RECHNER-FRAMEWORK
   Optimiert für Joomla (Helix Ultimate / Flex)
   ========================================================================== */

:root {
    /* Geschützte Variablen gegen Template-Konflikte */
    --gm-major-color: #38b2e4;           /* Ihr spezifisches Blau */
    --gm-bg-deep: #020617;               /* Tiefes Dunkelblau */
    --gm-card-bg: #0f172a;               /* Card Hintergrund */
    --gm-text-main: #ffffff;             /* Haupttext / Titel */
    --gm-text-body: rgb(185, 185, 185);  /* Standard-Fließtext */
    --gm-text-dim: #94a3b8;              /* Gedimmter Text */
    --gm-input-bg: rgba(255, 255, 255, 0.05);
    --gm-border-alpha: rgba(255, 255, 255, 0.1);
}

/* 1. GLOBAL LAYOUT & HINTERGRUND
   Abdunkeln der Template-Bereiche zur Vermeidung weißer Ränder */
body, 
#sp-top-bar, 
#sp-header, 
#sp-main-body, 
#sp-section-3, 
#sp-footer,
.container-inner {
    background-color: var(--gm-bg-deep) !important;
}

.page-wrapper {
    background-color: var(--gm-bg-deep);
    background-image:
        radial-gradient(at 0% 0%, rgba(30, 58, 138, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(15, 23, 42, 0.8) 0px, transparent 50%);
    min-height: 100vh;
    padding: 60px 20px;
    color: var(--gm-text-body);
    font-family: 'Inter', sans-serif;
}

/* Zentrierter Container für Rechner-Inhalte */
.rechner-container { 
    max-width: 800px; 
    margin: 0 auto; 
}

/* 2. TYPOGRAFIE & TITEL */
h1.formula-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 45px;
    color: var(--gm-text-main);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

h1.formula-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 130%; 
    height: 1px;
    background: linear-gradient(to right,
        var(--gm-major-color) 0%,
        var(--gm-major-color) 60%,
        rgba(148, 163, 184, 0.3) 60%,
        rgba(148, 163, 184, 0.3) 100%);
}

.intro-text { 
    font-size: 16px; 
    margin-bottom: 40px; 
    line-height: 1.6;
}

/* 3. RECHNER CARD DESIGN */
.rechner-card {
    background-color: var(--gm-card-bg);
    background-image: radial-gradient(at 50% 0%, rgba(30, 58, 138, 0.3) 0px, transparent 60%);
    border: 1px solid var(--gm-border-alpha);
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-bottom: 50px;
}

.rechner-content { padding: 40px; }

.label { 
    color: var(--gm-text-main);
    font-size: 13px; 
    font-weight: 700; 
    margin-bottom: 12px; 
    display: block; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 4. FORMULARFELDER & TOGGLE BUTTONS */
.form-group { margin-bottom: 25px; }

/* Verhindert weißes Aufblitzen der Eingabefelder */
.form-control {
    display: block; 
    width: 100%; 
    height: 50px; 
    padding: 0 15px;
    background-color: var(--gm-input-bg) !important; 
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 8px; 
    color: #fff !important; 
    margin-bottom: 0;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: var(--gm-major-color) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 178, 228, 0.15);
}

/* Inline-Einheitenumschaltung (Hinter dem Feld) */
.input-with-units {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gm-input-bg);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 4px;
}

.input-with-units .form-control {
    border: none !important;
    background: transparent !important;
    margin-bottom: 0;
}

/* Toggle-Buttons im Bubble-Stil */
.gm-toggle-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 2px;
}

.gm-btn-toggle {
    background: transparent;
    border: none;
    color: var(--gm-text-dim);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    text-transform: none; /* Keine Zwangs-Großschreibung für Einheiten */
}

/* Hervorhebung des aktiven Zustands */
.gm-btn-toggle.active {
    background: var(--gm-major-color) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(56, 178, 228, 0.3);
}

/* 5. CALCULATE BUTTON */
.btn-calculate {
    width: 100%; 
    height: 56px; 
    background: transparent;
    border: 1px solid var(--gm-major-color); 
    color: var(--gm-major-color);
    text-transform: uppercase; 
    font-weight: 700; 
    letter-spacing: 2px;
    cursor: pointer; 
    border-radius: 12px; 
    transition: 0.3s;
    margin-top: 10px;
}

.btn-calculate:hover {
    background: var(--gm-major-color);
    color: #fff;
    box-shadow: 0 10px 20px rgba(56, 178, 228, 0.2);
}

/* 6. ERGEBNISBEREICH */
.res-area { 
    background: rgba(255,255,255,0.02); 
    padding: 45px 40px; 
    text-align: center; 
    border-top: 1px solid var(--gm-border-alpha); 
}

.result-val { 
    font-size: 64px; 
    font-weight: 800; 
    color: var(--gm-major-color); 
    font-family: 'Montserrat'; 
    line-height: 1;
    margin-bottom: 5px;
}

.result-unit { 
    font-size: 16px; 
    color: var(--gm-text-dim); 
    text-transform: none !important; /* Verhindert die erzwungene Großschreibung */
    letter-spacing: 1px;
}
.interpretation-box {
    margin-top: 35px; 
    padding: 25px; 
    background: rgba(56, 178, 228, 0.05);
    border-left: 4px solid var(--gm-major-color); 
    border-radius: 4px;
    text-align: left;
}

/* 7. BIBLIOGRAFIE & QUELLEN */
.bibliography {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--gm-border-alpha);
}

.bib-list { list-style: none; padding: 0; }
.bib-item { 
    margin-bottom: 15px; 
    font-size: 13px; 
    line-height: 1.6;
}

.bib-link {
    color: var(--gm-major-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.bib-link:hover { text-decoration: underline; }

/* --- Optimierte Schalter & Toggles --- */

.gm-toggle-group {
    display: flex;
    width: 100%; /* Füllt die ganze Zeile aus */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 30px; /* Mehr Abstand zur nächsten Überschrift/Label */
    border: 1px solid var(--gm-border-alpha);
}

.gm-btn-toggle {
    flex: 1; /* Buttons teilen sich den Platz gleichmäßig auf */
    background: transparent;
    border: none;
    color: var(--gm-text-dim);
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: none !important; /* WICHTIG: Erlaubt "cm", "µmol/l" etc. */
}

.gm-btn-toggle.active {
    background: var(--gm-major-color) !important; /* Ihr Blau #38b2e4 */
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(56, 178, 228, 0.3);
}

/* Zeile mit Eingabefeld UND Schalter rechts daneben */
.input-row-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 25px;
}

.input-row-inline .form-control {
    flex: 1; /* Eingabefeld nimmt den Hauptplatz ein */
    margin-bottom: 0 !important;
}

.input-row-inline .gm-toggle-group {
    flex: 0 0 auto; /* Schaltergruppe behält ihre Breite */
    width: 160px; /* Definierte Breite für die Einheiten-Schalter */
    margin-bottom: 0 !important;
}