:root {
    --bg-dark: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
}

.glass-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.app-header {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 4px solid #06b6d4;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(6, 182, 212, 0.1);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
    pointer-events: none;
}

.app-header .header-content {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 1;
}

.header-icon {
    background: rgba(6, 182, 212, 0.1);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(6, 182, 212, 0.1); }
    to { box-shadow: 0 0 30px rgba(6, 182, 212, 0.4); }
}

.header-text {
    text-align: left;
    flex: 1;
}

.tech-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.tech-subtitle {
    font-size: 1rem;
    color: #06b6d4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-description {
    margin-top: 10px;
    color: var(--text-light);
    max-width: 900px;
    line-height: 1.5;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--panel-border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

h3 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 2rem 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="text"], 
input[type="number"], 
input[type="date"],
select, 
textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.dynamic-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Custom Checkbox */
.checkbox-group {
    margin-bottom: 1rem;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
    font-weight: 300;
}

/* Report Panel */
.report-panel {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 1rem;
}

.report-header h2 {
    font-size: 1.5rem;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.report-header .subtitle {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
}

.report-section {
    margin-bottom: 1.5rem;
}

.report-section h4 {
    font-size: 1.1rem;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.report-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.nodule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.nodule-table th, .nodule-table td {
    border: 1px solid #cbd5e1;
    padding: 0.5rem;
    text-align: left;
}

.nodule-table th {
    background-color: #f1f5f9;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}

.badge-2 { background: #dcfce7; color: #166534; }
.badge-3 { background: #fef9c3; color: #854d0e; }
.badge-4A { background: #ffedd5; color: #9a3412; }
.badge-4B { background: #fee2e2; color: #991b1b; }
.badge-4X { background: #fecaca; color: #7f1d1d; }

.remove-btn-container {
    text-align: center;
}

/* Image Radio Buttons (TIRADS Style) */
.findings {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: inline-block;
}
.image-selector-group {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s ease;
}
.image-selector-group:hover {
    background: rgba(255, 255, 255, 0.04);
}
.image-selector-group h4 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    letter-spacing: -0.2px;
}
.image-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}
.image-selector label {
    margin-bottom: 0;
}
[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
[type=radio] + .img-wrapper {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    width: 150px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
[type=radio] + .img-wrapper img.img-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
[type=radio]:checked + .img-wrapper {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3);
    background: rgba(59, 130, 246, 0.1);
}

.group-selector-container {
    margin-bottom: 25px;
}
.group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.group-btn {
    flex: 1 1 calc(33% - 12px);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}
.group-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}
.group-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.image-selector-group {
    display: none;
    background: var(--panel-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(20px);
}
.image-selector-group.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
[type=radio] + .img-wrapper:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
[type=radio] + .img-wrapper p {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

/* Image Slider */
.slider-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
}
.slide {
    display: none;
    text-align: center;
    padding: 0.5rem;
}
.slide img {
    max-height: 140px;
    max-width: 100%;
    border-radius: 4px;
}
.slide.active {
    display: block;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.slider-btn:hover {
    background: var(--accent-color);
}
.slider-prev { left: 5px; }
.slider-next { right: 5px; }
.slider-caption {
    font-size: 0.75rem;
    color: #cbd5e1;
    margin-top: 4px;
}

/* Report Nodule Image */
.report-nodule-img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    margin-top: 5px;
}

.print-verification {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.verification-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-light);
    cursor: pointer;
}
.verification-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Range Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.range-container input[type="number"] {
    flex: 0 0 100px;
    width: 100px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
}
.range-container input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* Live Result Card */
.live-result-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-top: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}
.live-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
.live-category {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
}
.live-description {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin: 0;
}
.live-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}
.live-recommendation {
    font-size: 1rem;
    color: #e2e8f0;
    margin-bottom: 24px;
}
.live-action-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.live-action-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Timeline Styles */
.timeline-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}
.timeline-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.timeline-visual {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 40px 50px 70px 50px;
    min-height: 120px;
}
.timeline-item {
    display: flex;
    align-items: center;
    position: relative;
}
.timeline-node {
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    position: relative;
    z-index: 2;
}
.timeline-date-label {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #cbd5e1;
    white-space: nowrap;
}
.timeline-connector {
    width: 100px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}
.timeline-gap-badge {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.timeline-delete {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.timeline-node-container:hover .timeline-delete {
    opacity: 1;
}
.timeline-node-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    #particles-js, .non-printable, header {
        display: none !important;
    }
    .glass-container {
        padding: 0;
        max-width: 100%;
    }
    main {
        display: block;
    }
    .report-panel {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    .badge {
        border: 1px solid #000;
        background: transparent !important;
        color: black !important;
    }
}

/* Footer Branding */
.branding-footer {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.branding-footer p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.branding-footer .disclaimer {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
