/* Variables */
:root {
    --primary-color: #5865F2;
    --success-color: #43B581;
    --warning-color: #FAA61A;
    --error-color: #F04747;
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #1a1a1a;
    --bg-card-hover: #242424;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --gradient-primary: linear-gradient(135deg, #5865F2 0%, #7289da 100%);
    --gradient-success: linear-gradient(135deg, #43B581 0%, #52a875 100%);
    --gradient-error: linear-gradient(135deg, #F04747 0%, #dc3545 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(88, 101, 242, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(67, 181, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(250, 166, 26, 0.03) 0%, transparent 50%);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-progress {
    width: 100%;
    margin-top: 1rem;
}

.overall-progress {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.overall-progress .progress-bar {
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.overall-progress .progress-fill {
    height: 100%;
    transition: width 1s ease;
    position: relative;
}

.overall-progress .progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.overall-progress .progress-text {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Verhindert dass Bild überlappt */
    flex-shrink: 0; /* Verhindert Verkleinerung */
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

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

.logo-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.overall-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.overall-status.operational {
    background: var(--gradient-success);
    color: white;
    border: 1px solid rgba(67, 181, 129, 0.3);
}

.overall-status.degraded {
    background: var(--gradient-error);
    color: white;
    border: 1px solid rgba(250, 166, 26, 0.3);
}

.overall-status.down {
    background: var(--gradient-error);
    color: white;
    border: 1px solid rgba(240, 71, 71, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Main Content */
.main {
    padding: 1rem 0;
    flex: 1;
}

.services-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

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

.service-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.service-status.up {
    background: var(--gradient-success);
    color: white;
}

.service-status.down {
    background: var(--gradient-error);
    color: white;
}

.service-metrics {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.metric-item {
    flex: 1;
    min-width: 0;
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    min-height: 20px;
    white-space: nowrap;
}

.metric-icon {
    font-size: 0.7rem;
}

.metric-value.up {
    color: var(--success-color);
    background: rgba(67, 181, 129, 0.1);
    border-color: rgba(67, 181, 129, 0.2);
}

.metric-value.down {
    color: var(--error-color);
    background: rgba(240, 71, 71, 0.1);
    border-color: rgba(240, 71, 71, 0.2);
}

.metric-value.excellent {
    color: var(--success-color);
    background: rgba(67, 181, 129, 0.1);
    border-color: rgba(67, 181, 129, 0.2);
}

.metric-value.good {
    color: var(--warning-color);
    background: rgba(250, 166, 26, 0.1);
    border-color: rgba(250, 166, 26, 0.2);
}

.metric-value.fair {
    color: #FAA61A;
    background: rgba(250, 166, 26, 0.1);
    border-color: rgba(250, 166, 26, 0.2);
}

.metric-value.poor {
    color: var(--error-color);
    background: rgba(240, 71, 71, 0.1);
    border-color: rgba(240, 71, 71, 0.2);
}

.service-progress {
    margin-top: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.15rem;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.progress-fill.excellent {
    background: var(--gradient-success);
}

.progress-fill.good {
    background: linear-gradient(135deg, #FAA61A 0%, #f59e0b 100%);
}

.progress-fill.fair {
    background: linear-gradient(135deg, #FAA61A 0%, #d97706 100%);
}

.progress-fill.poor {
    background: var(--gradient-error);
}

.progress-text {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.service-error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(240, 71, 71, 0.1);
    border: 1px solid rgba(240, 71, 71, 0.2);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* History Section */
.history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-chart {
    min-height: 150px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.history-chart h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.status-bars-container {
    margin-bottom: 1rem;
}

.status-bars {
    display: flex;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    margin-bottom: 0.75rem;
    position: relative;
}

.status-bar-segment {
    position: relative;
    transition: all 0.3s ease;
}

.status-bar-segment:hover {
    transform: scaleY(1.2);
    z-index: 10;
    filter: brightness(1.2);
}

.status-bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.status-bar-segment:hover .status-bar-tooltip {
    opacity: 1;
}

.status-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.legend-color.operational {
    background: #43B581;
}

.legend-color.down {
    background: #F04747;
}

.status-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.detail-value {
    font-weight: 600;
    font-size: 0.8rem;
}

.detail-value.operational {
    color: #43B581;
}

.detail-value.down {
    color: #F04747;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-top: 1rem;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

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

.footer-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card {
    animation: fadeIn 0.5s ease-out;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: rgba(240, 71, 71, 0.1);
    border: 1px solid rgba(240, 71, 71, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    color: var(--error-color);
    text-align: center;
}
