/* --- VRANA CORPORATE THEME --- */
:root {
    --vrana-dark-blue: #002b49;
    --vrana-accent-blue: #005b9f;
    --vrana-light-blue: #e6f0f9;
    --bg-color: #f4f7f8;
    --text-main: #333333;
    --border-color: #d1d5db;
}

* { box-sizing: border-box; }

html, body { 
    height: 100vh; margin: 0; overflow: hidden; background-color: var(--bg-color); 
    font-family: 'Montserrat', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    display: flex; flex-direction: column; color: var(--text-main);
}

.vrana-header {
    background-color: var(--vrana-dark-blue); color: white; height: 60px;
    display: flex; align-items: center; padding: 0 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); flex-shrink: 0; z-index: 100; justify-content: space-between;
}

.header-left { display: flex; align-items: center; }
.vrana-logo { display: flex; align-items: center; margin-right: 15px; text-decoration: none; transition: opacity 0.2s; }
.vrana-logo:hover { opacity: 0.8; }
.vrana-logo img { height: 32px; width: auto; }
.vrana-divider { width: 1px; height: 30px; background-color: rgba(255,255,255,0.3); margin-right: 15px; }
.vrana-title { font-weight: 400; font-size: 16px; letter-spacing: 0.5px; color: #e0e0e0; }

.btn-cta { background-color: transparent; color: white; border: 1px solid rgba(255,255,255,0.5); padding: 6px 15px; border-radius: 4px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.btn-cta:hover { background-color: white; color: var(--vrana-dark-blue); }

.app-container { flex: 1; display: flex; flex-direction: column; padding: 20px; overflow: hidden; }

.card { background: white; border-radius: 6px; padding: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); margin-bottom: 20px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.05); }
h2 { margin-top: 0; color: var(--vrana-dark-blue); font-weight: 700; font-size: 1.4rem; }
.status-msg { font-weight: 600; color: #b45309; margin-top: 15px; margin-bottom: 0; font-size: 14px; }

#treeCard, #viewerCard, #imageViewerCard, #srViewerCard { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; padding: 0; background: transparent; box-shadow: none; border: none; }
#dicomTreeContainer { flex: 1; overflow-y: auto; background: #fff; border-radius: 6px; border: 1px solid var(--border-color); font-family: 'Consolas', 'Courier New', monospace; font-size: 0.9rem; min-height: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.viewer-content { display: flex; flex-direction: column; flex: 1; min-height: 0; background: transparent; }
.viewer-title { text-align: center; font-size: 14px; color: var(--vrana-dark-blue); margin: 5px 0 10px 0; font-weight: 600; }
#waveformCanvas { flex: 1; width: 100%; min-height: 150px; background: #fff; border-radius: 6px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px rgba(0,0,0,0.05); cursor: crosshair; } 

.controls-panel { background: #fff; padding: 20px 25px; flex-shrink: 0; overflow-y: auto; max-height: 40vh; border-radius: 6px; border: 1px solid var(--border-color); margin-top: 15px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.control-row { display: grid; grid-template-columns: 200px 1fr 90px; gap: 20px; align-items: center; margin-bottom: 5px; }
.control-row:last-child { margin-bottom: 0; }
.slider-label { font-weight: 700; font-size: 14px; color: var(--vrana-accent-blue); text-transform: uppercase; letter-spacing: 0.5px; } 
.slider-label-black { font-weight: 600; font-size: 14px; color: var(--text-main); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; height: 18px; width: 18px; border-radius: 50%; background: var(--vrana-accent-blue); cursor: pointer; margin-top: -6px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.1s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 6px; cursor: pointer; background: #e2e8f0; border-radius: 3px; }

.val-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-color); text-align: center; font-size: 14px; font-family: inherit; font-weight: 600; color: var(--vrana-dark-blue); transition: all 0.2s; }
.val-input:focus { outline: none; border-color: var(--vrana-accent-blue); background: #fff; box-shadow: 0 0 0 3px rgba(0, 91, 159, 0.1); }

button, input[type="file"] { font-family: inherit; padding: 10px; border-radius: 4px; border: 1px solid #ccc; cursor: pointer; transition: all 0.2s; }
input[type="file"] { background: #fff; width: 100%; padding: 12px; border: 1px dashed var(--vrana-accent-blue); color: var(--vrana-dark-blue); font-weight: 500; }
input[type="file"]:hover { background: var(--vrana-light-blue); }

/* Spezifisches Styling für den kompakten Toolbar-Upload-Button */
#fileInput {
    width: 115px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: transparent !important; /* Versteckt den Standard-Text neben dem Button */
}
#fileInput:hover {
    background: transparent !important; /* Verhindert den blauen Hover-Hintergrund aus der globalen Regel */
}

.btn-primary { background-color: var(--vrana-accent-blue); color: white; font-weight: 600; width: 100%; font-size: 1.1rem; flex-shrink: 0; border: none; padding: 12px; box-shadow: 0 2px 4px rgba(0, 91, 159, 0.3); }
.btn-primary:hover { background-color: var(--vrana-dark-blue); transform: translateY(-1px); }
.btn-green { background-color: #047857; }
.btn-green:hover { background-color: #064e3b; }
.btn-play { background-color: #fff; color: var(--vrana-accent-blue); border: 1px solid var(--vrana-accent-blue); padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-play:hover { background-color: var(--vrana-light-blue); }
.btn-play.playing { background-color: var(--vrana-accent-blue); color: #fff; }
.btn-back { background: white; color: var(--text-main); font-weight: 600; padding: 8px 16px; border: 1px solid var(--border-color); width: auto; align-self: flex-start; margin-bottom: 15px; border-radius: 4px; font-size: 14px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-back:hover { background: #f9fafb; border-color: #9ca3af; }

#progressContainer { display: none; background-color: #e5e7eb; border-radius: 4px; overflow: hidden; margin-top: 15px; height: 12px; width: 100%; }
#progressBar { width: 0%; height: 100%; background-color: var(--vrana-accent-blue); transition: width 0.1s linear; }

/* Validation Badges */
.val-badge { display: inline-block; padding: 3px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; vertical-align: middle; font-family: 'Segoe UI', sans-serif;}
.val-err-badge { background: #fee2e2; color: #dc2626; border: 1px solid #f87171; }
.val-ok { background: #dcfce7; color: #059669; border: 1px solid #6ee7b7; }
.val-cond { background: #fef9c3; color: #d97706; border: 1px solid #fde047; cursor: help; }
.val-opt { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.val-text-err { color: #dc2626 !important; font-weight: bold; text-decoration: underline dotted #dc2626; cursor: help;}

#validationReport { display: none; padding: 15px 20px; border-radius: 6px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); max-height: 25vh; overflow-y: auto; }
#validationReport h3 { margin: 0 0 10px 0; font-size: 14px; display: flex; align-items: center; }
#validationReport ul { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; font-family: 'Consolas', monospace; }
#validationReport p { margin: 0; font-size: 13px; }

.val-report-err { background: #fef2f2; border-left: 4px solid #dc2626; color: #7f1d1d; }
.val-report-err h3 { color: #dc2626; }
.val-report-ok { background: #f0fdf4; border-left: 4px solid #10b981; color: #064e3b; }
.val-report-ok h3 { color: #059669; }
.val-report-info { background: #f8fafc; border-left: 4px solid #3b82f6; color: #334155; }
.val-report-info h3 { color: #2563eb; }

/* FIX: Mindestgröße für den DICOM-Baum, damit er auf Laptops lesbar bleibt */
#dicomTreeContainer { flex: 1; overflow-y: auto; background: #fff; border-radius: 6px; border: 1px solid var(--border-color); font-family: 'Consolas', 'Courier New', monospace; font-size: 0.9rem; min-height: 250px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* NEU: Orange Klasse für Warnungen (T1C / T2C) in der Baumansicht */
.dicom-row-warning { background-color: #fffbeb !important; border-left: 5px solid #f59e0b !important; }
.dicom-row-warning:hover { background-color: #fef3c7 !important; }

/* Flexibles Grid: Tag (fix) | Desc (flex) | Req (fix) | Mod (flex) | VR (fix) | VM (fix) | Val (flex) */
.dicom-header { display: grid; grid-template-columns: 180px minmax(200px, 2fr) 80px minmax(120px, 1.5fr) 45px 45px minmax(200px, 3fr); gap: 15px; padding: 12px 20px; background-color: #f8fafc; font-weight: 700; color: var(--vrana-dark-blue); position: sticky; top: 0; z-index: 10; border-bottom: 2px solid var(--border-color); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
	.dicom-row { display: grid; grid-template-columns: 180px minmax(200px, 2fr) 80px minmax(120px, 1.5fr) 45px 45px minmax(200px, 3fr); gap: 15px; padding: 8px 20px; border-bottom: 1px solid #f1f5f9; align-items: start; }.dicom-row:hover { background-color: var(--vrana-light-blue); }
details { margin: 0; } summary { list-style: none; outline: none; } summary::-webkit-details-marker { display: none; } 
summary.dicom-row { cursor: pointer; background-color: #f8fafc; font-weight: 700; }
summary.dicom-row:hover { background-color: #f1f5f9; }
.toggle-icon { display: inline-block; width: 14px; text-align: center; margin-right: 6px; color: var(--vrana-accent-blue); font-size: 0.75rem; transition: transform 0.1s; }
details[open] > summary .toggle-icon { transform: rotate(90deg); }
.tag { color: #64748b; font-weight: 700; white-space: nowrap; }
.tag-name { color: var(--vrana-dark-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; display: flex; align-items: center; }
.req-col { color: #64748b; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center;}
.vr { color: #059669; font-weight: 700; }
.value { color: var(--text-main); word-break: break-all; }
.binary-clickable { color: var(--vrana-accent-blue); border-bottom: 1px dashed var(--vrana-accent-blue); cursor: pointer; font-weight: 700; transition: all 0.2s; padding: 2px 4px; border-radius: 3px; }
.binary-clickable:hover { background-color: var(--vrana-light-blue); color: var(--vrana-dark-blue); }
.numeric-value { color: #d97706; font-weight: 700; }

.vrana-footer { text-align: center; font-size: 12px; color: #94a3b8; padding: 10px 0 0 0; font-weight: 500; }
.vrana-footer a { color: var(--vrana-accent-blue); text-decoration: none; }
.vrana-footer a:hover { text-decoration: underline; }

.btn-group { display: flex; gap: 15px; margin-top: 20px; }

/* Kompakte Ansicht für das Upload-Fenster nach dem Initial-Load */
.card.compact {
    padding: 10px 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}
.card.compact h2 { display: none; }
.card.compact input[type="file"] { flex: 1; min-width: 120px; padding: 8px; margin: 0; }
.card.compact .status-msg { 
    margin: 0; 
    font-size: 14px; 
    white-space: normal; /* Ändert das zwingende 'nowrap', damit der Text bei Platzmangel umbrechen darf */
    line-height: 1.4;
}
.card.compact #progressContainer { width: 100%; margin-top: 0; }

/* --- LEGAL / DISCLAIMER PAGE --- */
.legal-content {
    overflow-y: auto;
    max-height: calc(100vh - 160px);
    padding-right: 10px;
    line-height: 1.6;
}
.legal-content h3 {
    color: var(--vrana-dark-blue);
    margin-top: 20px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}
.legal-content p {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 15px;
}
.legal-content ul {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 15px;
    padding-left: 20px;
}
.legal-content a {
    color: var(--vrana-accent-blue);
    text-decoration: none;
}
.legal-content a:hover {
    text-decoration: underline;
}

/* --- ERROR HIGHLIGHTING & ANIMATIONS --- */
.dicom-row.dicom-row-error { 
    background-color: #fee2e2; 
    border-left: 5px solid #ef4444; 
}
.dicom-row.dicom-row-error:hover { 
    background-color: #fca5a5; 
}

.dicom-row.dicom-row-warning { 
    background-color: #fffbeb; 
    border-left: 5px solid #f59e0b; 
}
.dicom-row.dicom-row-warning:hover { 
    background-color: #fef3c7; 
}

.tree-highlight { 
    animation: flashError 2s ease-out; 
}

@keyframes flashError {
    0% { background-color: #fde047; }
    30% { background-color: #f87171; }
    100% { background-color: inherit; } 
}

.error-link {
    color: #b91c1c;
    text-decoration: none;
    border-bottom: 1px dashed #b91c1c;
    transition: all 0.2s;
}
.error-link:hover {
    color: #7f1d1d;
    background-color: #fca5a5;
    border-radius: 2px;
}

.dicom-row.dicom-row-optional { 
    background-color: #ffffff; 
    border-left: 3px solid #e2e8f0; 
}
.dicom-row.dicom-row-optional:hover { 
    background-color: #f8fafc; 
}
/* Erzwingt eine blasse Textfarbe für alle Elemente in der optionalen Reihe */
.dicom-row.dicom-row-optional .tag,
.dicom-row.dicom-row-optional .tag-name,
.dicom-row.dicom-row-optional .req-col,
.dicom-row.dicom-row-optional .value,
.dicom-row.dicom-row-optional i {
    color: #94a3b8 !important;
}
.dicom-row.dicom-row-optional .val-opt {
    opacity: 0.6;
}

/* =========================================
   TOOLBAR & OMNIBOX STYLES (Cleaned Up)
   ========================================= */

.toolbar-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 20px !important;
}

.toolbar-tools {
    display: flex;
    flex-wrap: wrap; /* WICHTIG: Erlaubt das Umbrechen auf neue Zeilen */
    align-items: center;
    gap: 15px; 
    flex: 2;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap; /* WICHTIG: Erlaubt das Umbrechen innerhalb der Gruppe */
    align-items: center;
    gap: 8px;
}

/* =========================================
   RESPONSIVE LAYOUT FÜR KLEINE BILDSCHIRME
   ========================================= */
@media (max-width: 950px) {
    .toolbar-divider {
        display: none; /* Trennstriche auf dem Handy ausblenden */
    }
    
    .toolbar-group {
        /* Jede Gruppe nimmt auf Handys eine eigene Zeile ein */
        width: 100%;
        padding-bottom: 5px;
        border-bottom: 1px dashed #e2e8f0; 
    }
    
    .toolbar-group:last-child {
        border-bottom: none;
    }
    
    .toolbar-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar-status {
        width: 100%;
        align-items: flex-start; /* Status auf Handys linksbündig */
    }
    .toolbar-status .status-msg {
        text-align: left;
    }
}

.toolbar-label {
    font-weight: 600;
    color: #334155;
    font-size: 14px;
    white-space: nowrap;
}

.toolbar-divider {
    width: 1px;
    height: 30px;
    background: #cbd5e1;
    margin: 0 5px;
}

/* Dateiauswahl Spezial-Button */
#fileInput {
    width: 105px !important; /* Etwas schmaler gemacht, damit der Abstand links und rechts stimmt */
    padding: 0 !important;
    margin: 0 !important; /* Stellt sicher, dass keine unerwünschten Margins vorhanden sind */
    border: none !important;
    background: transparent !important;
    color: transparent !important;
    cursor: pointer;
    box-sizing: border-box; /* Garantiert, dass Padding/Border die Breite nicht beeinflussen */
}

/* Stellt sicher, dass der Datei-Name Text keinen zusätzlichen Platz beansprucht */
#fileInput::-webkit-file-upload-button {
    margin-right: 0;
}

#fileInput::file-selector-button {
    margin-right: 0;
}

#fileInput:hover { background: transparent !important; }

/* Omnibox / Suchfeld */
.omnibox-container {
    position: relative;
    width: 320px;
}

#sopSearchInput {
    padding: 8px 12px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.omnibox-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* Status Bereich rechts */
.toolbar-status {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 200px;
}
.toolbar-status .status-msg {
    margin: 0;
    font-size: 13.5px;
    text-align: right;
}
.toolbar-status #progressContainer {
    width: 150px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-bottom: 4px;
}

/* =========================================
   COOKIE CONSENT BANNER
   ========================================= */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--vrana-dark-blue);
    color: white;
    padding: 15px 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    gap: 15px;
    font-size: 13.5px;
}

.cookie-consent-banner p { 
    margin: 0; 
    flex: 1; 
    min-width: 250px; 
    line-height: 1.5; 
    color: #e2e8f0;
}

.cookie-consent-banner a { 
    color: #38bdf8; 
    text-decoration: none; 
    font-weight: 600; 
}
.cookie-consent-banner a:hover { 
    text-decoration: underline; 
}

.cookie-btn-group { 
    display: flex; 
    gap: 10px; 
}

.cookie-btn { 
    padding: 8px 20px; 
    border-radius: 4px; 
    border: none; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    font-size: 13px; 
}
.cookie-btn-accept { 
    background-color: #059669; 
    color: white; 
}
.cookie-btn-accept:hover { 
    background-color: #047857; 
}
.cookie-btn-decline { 
    background-color: transparent; 
    color: white; 
    border: 1px solid rgba(255,255,255,0.5); 
}
.cookie-btn-decline:hover { 
    background-color: rgba(255,255,255,0.1); 
}