/* Boat Tracks Metrics Dashboard Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
}

.status-text {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.status-indicator.healthy .status-text {
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

.status-indicator.unhealthy .status-text {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.status-indicator.loading .status-text {
    background: rgba(251, 191, 36, 0.2);
    color: #d97706;
}

.last-updated {
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.metric-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* Overview Card */
.overview-card {
    grid-column: span 2;
}

.overview-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.service-status h3,
.error-summary h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #475569;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.service-name {
    font-weight: 500;
}

.service-indicator {
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.service-indicator.healthy {
    color: #22c55e;
}

.service-indicator.unhealthy {
    color: #ef4444;
}

.service-indicator.unknown {
    color: #94a3b8;
}

.error-count {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.error-value {
    font-weight: 600;
    color: #dc2626;
}

.error-value.zero {
    color: #22c55e;
}

/* Metrics Content */
.metrics-content {
    space-y: 16px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: #64748b;
}

.metric-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

/* Chart Container */
.metric-chart-container {
    margin-top: 20px;
    height: 200px;
    position: relative;
}

/* Memory and Failure Lists */
.memory-list,
.failure-list {
    space-y: 8px;
}

.memory-item,
.failure-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.failure-item {
    border-left-color: #ef4444;
}

.memory-process,
.failure-service {
    font-weight: 500;
    color: #374151;
}

.memory-usage {
    font-weight: 600;
    color: #1e293b;
}

.failure-count {
    font-weight: 600;
    color: #dc2626;
}

/* Failures Card */
.failures-card .metric-card {
    border-left: 4px solid #ef4444;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .overview-card {
        grid-column: span 1;
    }

    .overview-metrics {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

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

    .header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 15px;
    }

    .metric-card {
        padding: 20px;
    }
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 20px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Error States */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.error-message h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}
