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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1a202c;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    font-weight: 400;
}

/* Alert Section */
.alert-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.alert-section.has-collapsed-content {
    padding-bottom: 8px;
}

/* All Good State */
.all-good-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 10px;
    border: 2px solid #10b981;
}

.all-good-icon {
    font-size: 2rem;
    color: #059669;
}

.all-good-content h2 {
    color: #065f46;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.all-good-content p {
    color: #047857;
    font-size: 0.85rem;
    margin: 0;
}

/* Alert Header */
.alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.alert-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.alert-title i {
    color: #dc2626;
    font-size: 1.2rem;
}

.collapse-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collapse-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.collapse-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collapse-btn i {
    color: #64748b;
    font-size: 0.9rem;
    transition: transform 0.3s ease, color 0.2s ease;
}

.collapse-btn:hover i {
    color: #475569;
}

.collapse-btn.collapsed i {
    transform: rotate(180deg);
}

.alert-content {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 1000px; /* Large enough to accommodate content */
}

.alert-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: -12px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Flash effect for highlighting rows */
.biomarker-row.flash-highlight {
    animation: flashHighlight 1.5s ease-in-out;
}

@keyframes flashHighlight {
    0%, 100% {
        background-color: inherit;
    }
    15% {
        background-color: #fbbf24 !important;
    }
    30% {
        background-color: #fef3c7 !important;
    }
    45% {
        background-color: #fbbf24 !important;
    }
    60% {
        background-color: #fef3c7 !important;
    }
    75% {
        background-color: #fbbf24 !important;
    }
    90% {
        background-color: #fef3c7 !important;
    }
}

.alert-title h2 {
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.alert-count {
    background: #dc2626;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Alert Grid */
.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

/* Alert Cards */
.alert-card {
    background: white;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #dc2626;
}

.alert-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #dc2626;
}

.alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.alert-card .biomarker-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.85rem;
    line-height: 1.1;
}

.alert-card-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-indicator-container {
    flex-shrink: 0;
}

.alert-card-body {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.current-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.current-value.high {
    color: #dc2626;
}

.current-value.low {
    color: #d97706;
}

.current-value .unit {
    font-size: 0.875rem;
    font-weight: 600;
    color: #9ca3af;
    margin-left: 3px;
}

.reference-text {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.1;
    text-align: right;
    flex-shrink: 0;
    font-weight: 500;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

.status-badge.status-high {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.status-low {
    background: #fef3c7;
    color: #d97706;
}

/* Controls */
.controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.controls h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
}

.control-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: rgba(107, 114, 128, 0.8);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-tab.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
}

/* Biomarkers Grid */
.biomarkers-grid {
    display: grid;
    gap: 24px;
    width: 100%;
}

.category-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.category-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.biomarker-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: var(--grid-template);
    gap: 1px;
    background: #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.table-header > div {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 15px 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-biomarker {
    text-align: left;
    justify-content: flex-start !important;
}

.biomarker-row {
    background: white;
    transition: all 0.2s ease;
}

.biomarker-row:hover {
    background: #f9fafb;
}

.biomarker-row:last-child .biomarker-main-row {
    border-bottom: none;
}

.biomarker-main-row {
    display: grid;
    grid-template-columns: var(--grid-template);
    gap: 1px;
    background: #e5e7eb;
    align-items: stretch;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
}

.biomarker-main-row > div {
    background: white;
    padding: 15px 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.cell-biomarker {
    align-items: center;
    text-align: left;
    justify-content: flex-start;
    line-height: 1.3;
}

.cell-unit,
.cell-reference,
.cell-trend,
.cell-result {
    justify-content: center;
    text-align: center;
}

.cell-actions {
    justify-content: center;
    gap: 8px;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    background: white;
    border-radius: 8px;
}

.result-value {
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.no-result {
    color: #9ca3af;
    font-style: italic;
}

/* Trend Indicators */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: help;
}

.trend-good {
    background: #d1fae5;
    color: #065f46;
}

.trend-bad {
    background: #fee2e2;
    color: #dc2626;
}

.trend-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.trend-none {
    color: #9ca3af;
    font-style: italic;
    background: none;
    border-radius: 0;
}

.biomarker-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
    flex-wrap: wrap;
}

.info-tooltip {
    position: relative;
    display: inline-block;
}

.info-icon {
    color: #6b7280;
    font-size: 0.8rem;
    cursor: help;
    transition: color 0.2s ease;
}

.info-icon:hover {
    color: #4f46e5;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: -8px;
    left: 120%;
    z-index: 1000;
    width: 300px;
    background: #1f2937;
    color: white;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-content::before {
    content: "";
    position: absolute;
    top: 12px;
    left: -5px;
    border: 5px solid transparent;
    border-right-color: #1f2937;
}

.info-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.biomarker-unit {
    color: #9ca3af;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

.biomarker-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-results-by-date {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4f46e5;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}

.date-results {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.result-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-badge .date {
    font-size: 0.75rem;
    opacity: 0.8;
}

.result-value.result-normal {
    background: #d1fae5;
    color: #065f46;
}

.result-value.result-high {
    background: #fee2e2;
    color: #dc2626;
}

.result-value.result-low {
    background: #fef3c7;
    color: #d97706;
}

.reference-range {
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-top: 4px;
    font-weight: 500;
}

.add-result-btn {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    min-width: 120px;
}

.add-result-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.expand-btn,
.detail-btn {
    background: none;
    border: none;
    padding: 8px;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.expand-btn:hover,
.detail-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.expand-btn.expanded {
    color: #4f46e5;
    background: #f0f0ff;
}

/* Expanded Biomarker Details */
.biomarker-expanded-content {
    grid-column: 1 / -1;
    padding: 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.expanded-chart {
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 8px;
    padding: 15px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.large-modal .modal-content {
    max-width: 1000px;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.close-btn:hover {
    background: #f3f4f6;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Bulk Test Grid */
.bulk-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.bulk-test-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.bulk-test-item label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    display: block;
}

.bulk-test-item .unit {
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 500;
}

.bulk-test-item input {
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Biomarker Detail Modal */
.biomarker-detail-content {
    display: grid;
    gap: 24px;
}

.detail-info {
    display: grid;
    gap: 16px;
}

.detail-description {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
    color: #374151;
    line-height: 1.6;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    min-height: 400px;
}

.history-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.history-table h3 {
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
    font-size: 1.1rem;
    color: #1f2937;
}

.table-container {
    max-height: 300px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-normal {
    color: #10b981;
}

.status-high {
    color: #ef4444;
}

.status-low {
    color: #f59e0b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

.biomarker-row.expanded .biomarker-main-row {
    border-bottom: 1px solid #e5e7eb;
}

/* Responsive Design */
@media (max-width: 1200px) and (min-width: 769px) {
    .biomarker-name {
        font-size: 0.88rem;
        line-height: 1.25;
        word-break: break-word;
        hyphens: auto;
    }
    
    .cell-biomarker {
        padding: 15px 8px;
        min-width: 280px;
    }
    
    .biomarker-main-row > div {
        align-items: center;
    }
}

@media (max-width: 1024px) {
    .table-header > div,
    .biomarker-main-row > div {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .biomarker-name {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .cell-biomarker {
        padding: 12px 6px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .table-header,
    .biomarker-main-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .table-header > div,
    .biomarker-main-row > div {
        text-align: left !important;
        justify-content: flex-start !important;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .table-header > div:before,
    .biomarker-main-row > div:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        min-width: 80px;
        display: inline-block;
    }
    
    .biomarker-name {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .tooltip-content {
        left: 0;
        top: 25px;
        width: 280px;
    }
    
    .tooltip-content::before {
        top: -5px;
        left: 12px;
        border: 5px solid transparent;
        border-bottom-color: #1f2937;
        border-right-color: transparent;
    }
    
    .trend-indicator {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .controls-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .filter-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .bulk-test-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .large-modal .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .alert-grid {
        grid-template-columns: 1fr;
    }
    
    .all-good-alert {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px;
    }
    
    .alert-card {
        padding: 8px;
    }
    
    .alert-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 4px;
    }
    
    .alert-card-header-right {
        gap: 4px;
    }
    
    .alert-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .reference-text {
        text-align: left;
    }
    
    .detail-stats {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Wide screen optimizations */
@media (min-width: 1440px) {
    .container {
        max-width: 2000px;
    }
    
    .table-header > div {
        padding: 18px 15px;
    }
    
    .biomarker-main-row > div {
        padding: 18px 15px;
        min-height: 70px;
    }
    
    .cell-biomarker {
        font-size: 1rem;
    }
    
    .biomarker-name {
        font-size: 1.05rem;
    }
}

@media (min-width: 1800px) {
    .container {
        max-width: 2400px;
    }
    
    .table-header > div {
        padding: 20px 18px;
        font-size: 1rem;
    }
    
    .biomarker-main-row > div {
        padding: 20px 18px;
        min-height: 75px;
    }
}

/* Body composition specific styles */
.percentage {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 4px;
}

.cell-result .percentage {
    display: block;
    margin-top: 2px;
    margin-left: 0;
    font-size: 0.8rem;
}

/* Body Composition Dashboard Styles */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.performance-dashboard,
.composition-dashboard {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.section-header h3 {
    color: #e5e7eb;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Alert section specific styling */
.alert-section .section-header h3 {
    color: #f97316;
    font-weight: 700;
}

.alert-section .section-header {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.alert-section .section-header:hover {
    background: rgba(249, 115, 22, 0.15);
}

.alert-section .collapse-icon {
    color: #f97316;
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin: 1rem 0 0.75rem 0;
}

.subsection-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.subsection-header h4 {
    color: #e5e7eb;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.collapse-icon {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: transform 0.3s ease, color 0.2s ease;
}

.collapse-icon:hover {
    color: #ffffff;
}

.subsection-icon {
    font-size: 0.75rem;
}

.section-content,
.subsection-content {
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
    overflow: hidden;
    max-height: 5000px; /* High enough to show all content */
}

.section-content.collapsed,
.subsection-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.performance-dashboard h3,
.composition-dashboard h3 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.performance-dashboard h4,
.composition-dashboard h4 {
    color: #e5e7eb;
    margin: 1rem 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Exercise Intensity Chart */
.exercise-intensity-chart {
    margin-bottom: 1.5rem;
}

/* Compact Intensity Chart */
.compact-intensity-chart {
    margin-bottom: 1rem;
}

.intensity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.compact-intensity-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.875rem;
    transition: all 0.3s ease;
}

.compact-intensity-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.intensity-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
}

.mini-details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-details-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.compact-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.compact-metric {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-label {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 30px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
}

.metric-unit {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.compact-progress {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.mini-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-track {
    flex: 1;
    height: 4px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.mini-fill.status-normal { background: #10b981; }
.mini-fill.status-high { background: #ef4444; }
.mini-fill.status-low { background: #f59e0b; }

.mini-label {
    color: #d1d5db;
    font-size: 0.625rem;
    min-width: 20px;
    text-align: right;
}

.intensity-levels {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.intensity-level {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.intensity-level:hover {
    background: rgba(255, 255, 255, 0.08);
}

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.level-header h5 {
    color: #ffffff;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.level-values {
    display: flex;
    gap: 1.5rem;
}

.vo2-value,
.hr-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vo2-value .label,
.hr-value .label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.vo2-value .value,
.hr-value .value {
    font-size: 1.125rem;
    font-weight: 700;
}

.vo2-value .unit,
.hr-value .unit {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-normal { color: #10b981; }
.status-high { color: #ef4444; }
.status-low { color: #f59e0b; }

/* Progress Bars */
.level-progress {
    margin-top: 1rem;
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-label {
    color: #d1d5db;
    font-size: 0.75rem;
    min-width: 120px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: rgba(75, 85, 99, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill.status-normal { background: #10b981; }
.progress-fill.status-high { background: #ef4444; }
.progress-fill.status-low { background: #f59e0b; }

.progress-text {
    color: #e5e7eb;
    font-size: 0.8rem;
    min-width: 80px;
    text-align: right;
    font-weight: 500;
}

/* Details Button */
.details-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

.details-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.metric-card.status-normal {
    border-color: rgba(16, 185, 129, 0.3);
}

.metric-card.status-high {
    border-color: rgba(239, 68, 68, 0.3);
}

.metric-card.status-low {
    border-color: rgba(245, 158, 11, 0.3);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-header h5 {
    color: #ffffff;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.metric-value .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.metric-value .unit {
    color: #9ca3af;
    font-size: 0.875rem;
}

.metric-reference {
    color: #e5e7eb;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Regional Breakdown */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.region-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.region-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.region-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.region-icon {
    font-size: 1.5rem;
}

.region-header h5 {
    color: #ffffff;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.total-mass {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 600;
}

.composition-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.composition-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.composition-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bar-track {
    height: 8px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.lean-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.fat-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bar-label .label {
    color: #d1d5db;
    font-size: 0.875rem;
    font-weight: 500;
}

.bar-label .value {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
}

.region-actions {
    display: flex;
    justify-content: flex-end;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.status-normal {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-low {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Biomarker Dashboard */
.biomarker-dashboard {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Section Layout */
.section {
    margin-bottom: 2rem;
}

/* Simple Controls */
.simple-controls {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.simple-controls .controls-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
}

.control-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 1);
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .level-values {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .progress-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .progress-label {
        min-width: auto;
    }
    
    .progress-text {
        text-align: left;
        min-width: auto;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .regions-grid {
        grid-template-columns: 1fr;
    }
    
    .intensity-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        padding: 0.5rem 0.25rem;
    }
    
    .section-header h3 {
        font-size: 1.125rem;
    }
    
    .subsection-header {
        padding: 0.25rem 0.125rem;
    }
    
    .subsection-header h4 {
        font-size: 0.9rem;
    }
} 