/* ============================================================================
   RAGANA LAB RESULTS - STYLES
   ============================================================================
   Customize these variables to match your main site's design
   ============================================================================ */

:root {
    /* Colors - Change these to match your main site */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-color: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================================
   HEADER - Customize to match your main site
   ============================================================================ */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* ============================================================================
   OVERVIEW SECTION
   ============================================================================ */

.overview-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
}

.overview-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
}

.filter-bar label {
    font-weight: 500;
    font-size: 0.875rem;
}

.filter-bar select {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 200px;
}

/* ============================================================================
   TABLES SECTION
   ============================================================================ */

.tables-section {
    padding: 3rem 0;
    flex: 1;
}

#tables-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Category Table Wrapper */
.category-table {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.category-header {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Data Table */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    cursor: help;
    transition: background-color 0.2s;
}

.data-table th:hover {
    background: var(--border-color);
}

.data-table th.quality-header {
    min-width: 120px;
}

.data-table th .header-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-table th .info-icon {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.data-table th:hover .info-icon {
    opacity: 1;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Date column */
.date-cell {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.institution-cell {
    color: var(--text-secondary);
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Value cells */
.value-cell {
    font-family: var(--font-mono);
    text-align: right;
}

.value-cell.empty {
    color: var(--text-light);
}

/* Out of range values - BOLD */
.value-cell.out-of-range {
    font-weight: 700;
    color: var(--danger-color);
}

.value-cell.out-of-range-low {
    font-weight: 700;
    color: var(--primary-color);
}

.value-cell.out-of-range-high {
    font-weight: 700;
    color: var(--danger-color);
}

/* Text values (negativ, etc.) */
.value-cell.text-value {
    font-family: var(--font-family);
    font-style: italic;
    color: var(--text-secondary);
}

/* Unit display */
.unit-badge {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-left: 0.25rem;
}

/* ============================================================================
   REFERENCE POPUP
   ============================================================================ */

.reference-popup {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.reference-popup.hidden {
    opacity: 0;
    transform: translateY(10px);
}

.reference-popup.visible {
    opacity: 1;
    transform: translateY(0);
}

.popup-content {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
}

.popup-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--primary-light);
}

.popup-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.popup-row {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.popup-label {
    color: var(--text-light);
    min-width: 100px;
    flex-shrink: 0;
}

.popup-value {
    color: var(--text-white);
    font-weight: 500;
}

.popup-comment {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-comment .popup-value {
    font-weight: 400;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ============================================================================
   FOOTER - Customize to match your main site
   ============================================================================ */

.site-footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    margin: 0;
}

.footer-note {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

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

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-white);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .overview-section h1 {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select {
        width: 100%;
    }
    
    .category-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.75rem;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .site-header,
    .site-footer,
    .filter-bar {
        display: none;
    }
    
    .overview-section {
        background: none;
        color: var(--text-primary);
        padding: 1rem 0;
    }
    
    .stats-grid {
        display: none;
    }
    
    .category-table {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .data-table th:hover {
        background: var(--bg-color);
    }
}
