/* Root Variables - Light Mode (Default) */
:root {
    /* Colors from theme */
    --color-primary: #535A92;
    --color-primary-dark: #BCC2FF;
    --color-success: #2c9c6b;
    --color-warning: #FFB300;
    --color-error: #BA1A1A;
    --color-info: #607d8b;

    /* Text Colors */
    --color-text-primary: #1B1B21;
    --color-text-secondary: #46464F;
    --color-text-disabled: rgba(27, 27, 33, 0.38);

    /* Background Colors */
    --color-bg-primary: #FBF8FF;
    --color-bg-paper: #FBF8FF;
    --color-bg-elevation1: #F3F0FA;
    --color-bg-elevation2: #EEEBF6;
    --color-bg-container: #EFEDF4;

    /* Border and Divider */
    --color-divider: #C7C5D0;
    --color-border: #777680;

    /* Drop Shadows */
    --shadow-elevation1: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
    --shadow-elevation2: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);

    /* Action Colors */
    --color-action-hover: rgba(27, 27, 33, 0.06);

    /* Logo Color */
    --color-logo: #000;
}

/* Dark Mode Variables */
body.dark-mode {
    --color-primary: #BCC2FF;
    --color-primary-dark: #252B61;
    --color-success: #3edc96;
    --color-warning: #FFB300;
    --color-error: #FFB4AB;
    --color-info: #90A4AE;

    /* Text Colors */
    --color-text-primary: #E4E1E9;
    --color-text-secondary: rgba(228, 225, 233, 0.70);
    --color-text-disabled: rgba(228, 225, 233, 0.50);

    /* Background Colors */
    --color-bg-primary: #131318;
    --color-bg-paper: #131318;
    --color-bg-elevation1: #1B1C24;
    --color-bg-elevation2: #21212A;
    --color-bg-container: #1F1F25;

    /* Border and Divider */
    --color-divider: #46464F;
    --color-border: #91909A;

    /* Action Colors */
    --color-action-hover: rgba(228, 225, 233, 0.06);

    /* Logo Color */
    --color-logo: #E5E4F6;
}

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

body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    letter-spacing: 0.1px;
    line-height: 1.5;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-divider);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 32px;
    width: auto;
}

.logo path {
    fill: var(--color-logo);
    transition: fill 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    background-color: var(--color-divider);
    border-radius: 14px;
    transition: background-color 0.3s ease;
    margin: 0 8px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

.toggle-label-light {
    margin-right: 8px;
}

.toggle-label-dark {
    margin-left: 8px;
}

body.dark-mode .toggle-label-dark {
    color: var(--color-text-primary);
}

body:not(.dark-mode) .toggle-label-light {
    color: var(--color-text-primary);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.page-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.last-updated {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Status Cards */
.status-card {
    background-color: var(--color-bg-paper);
    border: 1px solid var(--color-divider);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-elevation1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.overall-status {
    border-left: 4px solid var(--color-success);
}

.overall-status.status-degraded {
    border-left-color: var(--color-warning);
}

.overall-status.status-down {
    border-left-color: var(--color-error);
}

.status-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-icon {
    flex-shrink: 0;
}

.status-icon .icon {
    width: 48px;
    height: 48px;
    color: var(--color-success);
}

.overall-status.status-degraded .status-icon .icon {
    color: var(--color-warning);
}

.overall-status.status-down .status-icon .icon {
    color: var(--color-error);
}

.status-info {
    flex: 1;
}

.status-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text-primary);
}

.status-message {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Services Section */
.services-section {
    margin-top: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

/* Service Cards */
.service-card {
    background-color: var(--color-bg-elevation1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-elevation1);
    transition: background-color 0.3s ease;
}

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

.service-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.service-icon {
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: rgba(122, 134, 154, 0.08);
}

.status-badge.status-ok {
    background-color: rgba(44, 156, 107, 0.12);
    color: var(--color-success);
}

.status-badge.status-degraded {
    background-color: rgba(255, 179, 0, 0.12);
    color: var(--color-warning);
}

.status-badge.status-down {
    background-color: rgba(186, 26, 26, 0.12);
    color: var(--color-error);
}

body.dark-mode .status-badge.status-down {
    color: var(--color-error);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

.status-text {
    font-weight: 600;
}

/* Footer */
.footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--color-divider);
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Loading State */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-badge.status-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .page-title {
        font-size: 24px;
    }

    .status-card-content {
        flex-direction: column;
        text-align: center;
    }

    .service-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
