/* Modern Dark Mode & Glassmorphism Design System */
:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    padding: 2rem;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* Layout Grid */
.container {
    max-width: 98%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 1rem;
}

/* 3-Column Adaptation */
@media (max-width: 1100px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
}

/* Glass Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.panel-title {
    font-size: 1.5rem;
    color: #e2e8f0;
}

/* Controls & Inputs */
select,
button,
input {
    font-family: var(--font-body);
}

select option {
    background-color: #1e293b;
    /* Dark slate */
    color: #fff;
}

.control-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-record {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-record.recording {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(244, 63, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
    }
}

/* Transcript Area */
#transcript-box {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #cbd5e1;
    min-height: 300px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
    outline: none;
    overflow-y: auto;
}

#transcript-box:focus {
    border-color: var(--accent-color);
}

.low-confidence {
    color: #fca5a5;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    position: relative;
}

.low-confidence:hover::after {
    content: "Low confidence";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    white-space: pre;
    pointer-events: none;
    border: 1px solid var(--glass-border);
}

/* Diagnosis Cards */
.hypothesis-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hypothesis-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
}

.hypothesis-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.disease-name {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.confidence-score {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.questions-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent-color);
    margin-left: 0.5rem;
}

.question-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.9);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    z-index: 100;
}

/* Clinical Graph Components */
.graph-section {
    margin-bottom: 1.5rem;
}

.graph-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.timeline-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.8rem;
    padding: 1rem;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-card {
    display: flex;
    gap: 1rem;
    padding: 0.8rem;
    border-left: 2px solid var(--accent-color);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    transition: transform 0.2s;
}

.timeline-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
}

.t-date {
    font-family: 'Outfit';
    font-weight: 700;
    color: #fff;
    min-width: 80px;
    font-size: 0.9rem;
}

.t-content {
    font-size: 0.9rem;
}

/* Small Plus Button for Graph */
.btn-icon-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    /* Square with slight roundness */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.3rem;
}

.btn-icon-small:hover {
    background: var(--accent-color);
    color: white;
}



.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.clinical-chip {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 2rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: #e0f2fe;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clinical-chip:hover {
    background: rgba(56, 189, 248, 0.25);
}

.clinical-chip input {
    background: transparent;
    border: none;
    color: inherit;
    width: 80px;
    outline: none;
    font-size: inherit;
    font-family: inherit;
}

.chip-adj {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 0.5rem;
}

.chip-new {
    animation: chip-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chip-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    padding: 1rem;
}

/* Tree Visualization */
.tree-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: 'Inter', monospace;
    /* Monospace tech vibe */
}

.tree-node {
    display: flex;
    flex-direction: column;
    padding-left: 1rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.2);
    position: relative;
    margin-top: 0.5rem;
}

.node-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(56, 189, 248, 0.1);
    margin-bottom: 0.5rem;
    width: fit-content;
    min-width: 200px;
}

.mini-disease-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.probbar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-left: 10px;
}

.probbar span {
    display: block;
    height: 100%;
    background: var(--accent-color);
}

.tree-question {
    color: #fcd34d;
    /* Amber for Questions */
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.5rem 0 0.5rem 0.5rem;
}

.tree-branches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.5rem;
}

.branch-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.2rem;
    display: inline-block;
    font-weight: bold;
}

.branch-label.yes {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.branch-label.no {
    background: rgba(244, 63, 94, 0.2);
    color: #f43f5e;
}

/* Custom Date Input Styling */
.clinical-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clinical-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}