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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

h1 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.info-banner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.info-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.info-text {
    color: #495057;
    font-size: 14px;
    font-weight: 500;
}

.metrics-link {
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
}

.metrics-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.controls {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box input.search-flash {
    animation: searchFlash 0.3s ease;
}

@keyframes searchFlash {
    0% {
        background-color: white;
        border-color: #ced4da;
    }
    50% {
        background-color: #e7f3ff;
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    }
    100% {
        background-color: white;
        border-color: #ced4da;
    }
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #666;
}

.countdown {
    font-weight: 600;
    color: #667eea;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.metric-metadata {
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 4px;
    font-size: 12px;
}

.metric-type {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-help {
    color: #6c757d;
    line-height: 1.4;
    font-size: 12px;
}

.metric-type-value {
    cursor: help;
    border-bottom: 1px dotted #6c757d;
    transition: all 0.2s ease;
    position: relative;
}

.metric-type-value:hover {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* Custom tooltip styling using data-tooltip instead of title to prevent native tooltip */
.metric-type-value[data-tooltip] {
    position: relative;
}

.metric-type-value[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    width: 450px;
    max-width: 450px;
    text-align: left;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

.metric-type-value[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
    pointer-events: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.metric-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
    flex: 1;
    margin-right: 10px;
}

.metric-value {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    white-space: nowrap;
}

.metric-labels {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.metric-label {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s;
}

.metric-label.clickable-label {
    cursor: pointer;
}

.metric-label.clickable-label:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #0056b3;
}

.metric-label.clickable-label:hover .label-key,
.metric-label.clickable-label:hover .label-value {
    color: white;
}

.metric-label.clickable-label:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Highlight styles for search matches */
.search-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Highlight label that matches a filter */
.metric-label.label-highlighted {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border-color: #1e7e34;
}

.metric-label.label-highlighted .label-key,
.metric-label.label-highlighted .label-value {
    color: white;
}

/* Highlight label that matches text search */
.metric-label.label-text-match {
    box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.5);
}

.metric-label.label-text-match .search-highlight {
    background-color: transparent;
    text-decoration: underline;
    text-decoration-color: #333;
    text-decoration-thickness: 2px;
    padding: 0;
}

.label-key {
    color: #6c757d;
    font-weight: 600;
    margin-right: 4px;
}

.label-value {
    color: #495057;
}


.metric-chart {
    height: 170px;
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

.loading {
    text-align: center;
    color: white;
    font-size: 20px;
    margin-top: 100px;
}

.error {
    background: #ff5252;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.no-data {
    text-align: center;
    color: white;
    font-size: 18px;
    margin-top: 50px;
}

.help-text {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.tabs {
    background: white;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    position: relative;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.05);
}

.tab-button.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}


.footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    font-size: 14px;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}