:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-green: #2ea043;
    --accent-red: #da3633;
    --accent-blue: #58a6ff;
    --glass-border: 1px solid rgba(240, 246, 252, 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    margin-bottom: 3rem;
    text-align: center;
    animation: fadeIn Down 0.8s ease-out;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.service-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    font-size: 3rem;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
}

.status-indicator.up {
    background: radial-gradient(circle at 30% 30%, #4bd16f, var(--accent-green));
    box-shadow: 0 0 30px rgba(46, 160, 67, 0.4);
}

.status-indicator.down {
    background: radial-gradient(circle at 30% 30%, #ff5b5b, var(--accent-red));
    box-shadow: 0 0 30px rgba(218, 54, 51, 0.4);
}

.status-text {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.latency {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.latency span {
    color: var(--text-primary);
    font-weight: 700;
}

.severity-display {
    margin-top: 0.5rem;
    display: none;
}

.severity-display .severity-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metrics-grid-inline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card-inline {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(240, 246, 252, 0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.metric-card {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.history-section {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.history-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.history-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

.history-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.history-tab:hover {
    color: var(--text-primary);
}

.history-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.history-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(240, 246, 252, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.up .status-dot { background-color: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.down .status-dot { background-color: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(46, 160, 67, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 160, 67, 0); }
}

.up.pulse {
    animation: pulse 2s infinite;
}

.downs-section {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.8s backwards;
}

.downs-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--accent-red);
}

.downs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

.downs-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.downs-count span {
    color: var(--accent-red);
    font-weight: 700;
}

.clear-btn {
    background: rgba(218, 54, 51, 0.2);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-family);
}

.clear-btn:hover {
    background: rgba(218, 54, 51, 0.3);
    transform: translateY(-2px);
}

.downs-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.down-item {
    background: rgba(218, 54, 51, 0.1);
    border: 1px solid rgba(218, 54, 51, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.down-item:hover {
    background: rgba(218, 54, 51, 0.15);
    border-color: rgba(218, 54, 51, 0.3);
    transform: translateX(5px);
}

.down-item.empty {
    background: transparent;
    border: none;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
}

.down-service {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.down-service-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.down-badge {
    background: var(--accent-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.down-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.down-info-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.down-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.down-code {
    background: rgba(218, 54, 51, 0.2);
    color: var(--accent-red);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.down-latency {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.down-error {
    color: var(--accent-red);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.down-url {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: monospace;
    margin-top: 0.25rem;
    word-break: break-all;
}

.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.severity-badge.normal {
    background: rgba(46, 160, 67, 0.2);
    color: var(--accent-green);
}

.severity-badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.severity-badge.high {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.severity-badge.critical {
    background: rgba(218, 54, 51, 0.2);
    color: var(--accent-red);
}

.down-badge.high {
    background: rgba(255, 152, 0, 0.3);
    border-color: #ff9800;
    color: #ff9800;
}

.down-badge.critical {
    background: var(--accent-red);
    border-color: var(--accent-red);
}
