/* Stilizare generală & Culori tematice */
:root {
    --burgundy: #66000;
    --burgundy-dark: #4d0000;
    --burgundy-light: #f9f0f0;
    --accent-red: #d93838;
    --accent-green: #2e8b57;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #2b303b;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 12px rgba(102, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 1rem 2.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brain-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #660000, #990000);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 3px 6px rgba(102,0,0,0.3);
}

.brain-logo.sm {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 8px;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #660000;
    letter-spacing: -0.5px;
}

.brand-name span {
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #660000;
    background-color: var(--burgundy-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge-pro {
    background-color: var(--burgundy-light);
    color: #660000;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.avatar {
    width: 38px;
    height: 38px;
    background-color: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Hero */
.hero-section {
    text-align: center;
    padding: 1.5rem 0;
}

.hero-section h1 {
    font-size: 2.2rem;
    color: #660000;
    margin-bottom: 0.5rem;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Cards & Sections */
.card-section {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--burgundy-light);
    padding-bottom: 0.75rem;
}

.section-header h2 {
    font-size: 1.4rem;
    color: #660000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.text-burgundy {
    color: #660000;
}

/* Simulator Grid */
.simulator-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

.controls-panel {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.controls-panel h3 {
    font-size: 1.1rem;
    color: #660000;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.control-group input[type="range"] {
    accent-color: #660000;
    cursor: pointer;
}

.control-group select {
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.9rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.green { background-color: var(--accent-green); }
.dot.red { background-color: var(--accent-red); }

.btn-primary {
    background: linear-gradient(135deg, #660000, #880000);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #e5e7eb;
    color: var(--text-main);
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.inference-stats {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.inference-stats h4 {
    font-size: 0.95rem;
    color: #660000;
    margin-bottom: 0.25rem;
}

.inference-stats p {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.inference-stats strong {
    color: var(--text-main);
}

/* Viewport Panel */
.viewport-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.viewport-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.live-badge {
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.live-badge i {
    font-size: 0.5rem;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.ct-canvas-container {
    background-color: #111;
    border-radius: 12px;
    height: 440px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
}

.ct-image-mockup {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #2a3b4c 10%, #151c24 70%, #0a0d12 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simulated Masks */
.kidney-mask {
    position: absolute;
    width: 180px;
    height: 120px;
    background: rgba(46, 139, 87, 0.35);
    border: 2px dashed rgba(46, 139, 87, 0.8);
    border-radius: 40% 60% 50% 50% / 40% 40% 60% 60%;
    transition: all 0.3s ease;
}

.tumor-mask {
    position: absolute;
    width: 55px;
    height: 50px;
    background: rgba(217, 56, 56, 0.6);
    border: 2px solid rgba(217, 56, 56, 0.9);
    border-radius: 50%;
    top: 140px;
    left: 170px;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(217, 56, 56, 0.6);
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(102, 0, 0, 0.8);
    box-shadow: 0 0 8px #660000;
    display: none;
}

@keyframes scanAnimation {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.scanning .scan-line {
    display: block;
    animation: scanAnimation 2s ease-in-out infinite;
}

.viewport-overlay-text {
    position: absolute;
    bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: rgba(0,0,0,0.6);
    padding: 0.4rem 1rem;
    border-radius: 20px;
}

/* Analyzer Section */
.analyzer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.input-card, .metrics-card, .loss-controls, .loss-graph-container {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-card h3, .metrics-card h3, .loss-graph-container h4 {
    color: #660000;
    font-size: 1.1rem;
}

.category-result-box {
    background: var(--burgundy-light);
    border-left: 4px solid #660000;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.category-result-box h4 {
    color: #660000;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.category-result-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.metric-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill.burgundy {
    height: 100%;
    background-color: #660000;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.dice-score-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.score-circle {
    width: 75px;
    height: 75px;
    background: #660000;
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(102,0,0,0.3);
}

.score-circle span {
    font-size: 1.1rem;
    font-weight: 700;
}

.score-circle small {
    font-size: 0.6rem;
    opacity: 0.8;
}

.score-info h5 {
    font-size: 0.95rem;
    color: #660000;
    margin-bottom: 0.2rem;
}

.score-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Loss Section */
.loss-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

.mock-chart {
    background: white;
    height: 220px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 15px;
}

.chart-line {
    width: 100%;
    height: 70%;
    border-bottom: 3px solid #660000;
    border-left: 3px solid #660000;
    position: relative;
    background: linear-gradient(180deg, rgba(102,0,0,0.15) 0%, rgba(255,255,255,0) 100%);
    clip-path: polygon(0% 20%, 20% 45%, 40% 60%, 60% 75%, 80% 88%, 100% 95%);
    transition: all 0.5s ease;
}

.chart-tooltip {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--burgundy-light);
    color: #660000;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(102,0,0,0.2);
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.text-gray { color: var(--text-muted); }

/* Comparator Table */
.table-container {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.comparison-table th, .comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background-color: var(--bg-color);
    color: #660000;
    font-weight: 700;
}

.comparison-table tr:hover {
    background-color: var(--burgundy-light);
}

.highlight-row {
    background-color: rgba(102, 0, 0, 0.03);
}

.badge-success {
    background: rgba(46, 139, 87, 0.15);
    color: var(--accent-green);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-neutral {
    background: #e5e7eb;
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-warning {
    background: rgba(217, 56, 56, 0.15);
    color: var(--accent-red);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsiveness */
@media (max-width: 968px) {
    .simulator-grid, .analyzer-grid, .loss-grid {
        grid-template-columns: 1fr;
    }
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== V2 BRAIN identity + stronger opening ===== */
:root{--burgundy:#660000;--burgundy-dark:#4d0000}
.brain-header{background:#660000;border-bottom:1px solid #7d211d}
.brain-header-inner{max-width:1400px;margin:0 auto;min-height:118px;padding:18px 24px;display:flex;align-items:center;justify-content:space-between;gap:28px}
.brain-journal-logo{display:block;width:min(560px,58vw);height:auto;object-fit:contain;object-position:left center}
.brain-header-meta{color:#fff;text-align:right;border-left:1px solid rgba(255,255,255,.25);padding-left:26px;min-width:230px}
.brain-header-meta span,.brain-header-meta strong,.brain-header-meta small{display:block}.brain-header-meta span{font-size:.68rem;letter-spacing:.16em;color:#e8c67e}.brain-header-meta strong{font-family:Georgia,serif;font-size:1.55rem;margin:.15rem 0}.brain-header-meta small{font-size:.72rem;opacity:.78}
.navbar{position:sticky;top:0;padding:.72rem 2.5rem;border-bottom:1px solid #eadfda;box-shadow:0 3px 12px rgba(64,22,14,.06)}
.main-container{margin-top:1.35rem}
.hero-section{text-align:left;padding:0;overflow:hidden;border:1px solid #d6a553;border-radius:18px;background:linear-gradient(105deg,#fffaf0 0%,#fff 64%);box-shadow:0 12px 32px rgba(102,0,0,.10);position:relative}
.hero-section:before{content:"";position:absolute;left:0;top:0;bottom:0;width:8px;background:#660000}
.hero-kicker{padding:18px 28px 0 34px;color:#9a6c2c;font-size:.68rem;font-weight:800;letter-spacing:.17em}
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:24px;align-items:stretch;padding:10px 26px 28px 34px}
.hero-copy{padding:14px 0 8px}.hero-section h1{font-family:Georgia,'Times New Roman',serif;font-size:3rem;line-height:1.05;letter-spacing:-.03em;color:#660000;margin:0 0 15px}.hero-section h1 span{color:#342d2a;font-size:.78em}.hero-section p{margin:0;max-width:720px;font-size:1.04rem;line-height:1.6;color:#655b56}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:22px}.hero-actions a{text-decoration:none;border-radius:9px;padding:11px 15px;font-size:.82rem;font-weight:750}.hero-primary{background:#660000;color:#fff;box-shadow:0 5px 14px rgba(102,0,0,.2)}.hero-secondary{background:#fff6e4;color:#660000;border:1px solid #d4a253}
.hero-model{align-self:stretch;background:#660000;color:#fff;border-radius:13px;padding:20px;display:flex;flex-direction:column;justify-content:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.hero-model-label{font-size:.62rem;letter-spacing:.17em;color:#e9c87f;margin-bottom:15px}.hero-flow{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}.hero-flow span{border:1px solid rgba(255,255,255,.35);background:#76100a;border-radius:8px;padding:9px 10px;font-family:Georgia,serif;font-size:.82rem}.hero-flow i{font-style:normal;color:#e8bd66}
.hero-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:18px}.hero-metrics div{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);border-radius:8px;padding:9px}.hero-metrics b,.hero-metrics small{display:block}.hero-metrics b{font-family:Georgia,serif;color:#f2d48f;font-size:.9rem}.hero-metrics small{font-size:.62rem;opacity:.72;margin-top:2px}
#simulator.card-section{border:1px solid #d5a75a;box-shadow:0 10px 26px rgba(102,0,0,.09)}
#simulator .section-header{border-bottom-color:#e1c99d}
@media(max-width:968px){.brain-header-inner{min-height:92px}.brain-header-meta{display:none}.brain-journal-logo{width:min(560px,88vw)}.hero-grid{grid-template-columns:1fr}.hero-section h1{font-size:2.35rem}.navbar{top:0}.hero-model{min-height:210px}}
@media(max-width:600px){.brain-header-inner{padding:14px}.hero-grid{padding:8px 18px 22px 24px}.hero-kicker{padding-left:24px}.hero-section h1{font-size:1.9rem}.hero-metrics{grid-template-columns:1fr}.hero-actions a{width:100%;text-align:center}}

/* Bilateral case: second renal segmentation is shown only for Case #128. */
.kidney-mask-left{
    left: 18% !important;
    right: auto !important;
    transform: scaleX(-1) rotate(-8deg);
    display:none;
}
.tumor-mask-left{
    left: 25% !important;
    right: auto !important;
    top: 48% !important;
    width: 34px !important;
    height: 29px !important;
    display:none;
}
.ct-image-mockup.bilateral-active::after{
    content:"BILATERAL";
    position:absolute;
    right:12px;
    top:12px;
    z-index:12;
    padding:5px 8px;
    border:1px solid rgba(255,255,255,.5);
    border-radius:5px;
    background:rgba(102,0,0,.82);
    color:#fff;
    font-size:9px;
    font-weight:700;
    letter-spacing:.08em;
}
