/* Modern Dark Theme Dashboard */

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #27272a;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px var(--shadow);
}

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

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-indicator .text {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* Service Status Indicators */
.service-status-container {
    display: flex;
    gap: 12px;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    font-size: 13px;
    transition: all 0.3s ease;
}

.service-status:hover {
    background: rgba(255, 255, 255, 0.25);
}

.service-icon {
    font-size: 16px;
}

.service-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.service-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

.service-dot.offline {
    background: var(--danger);
}

.service-text {
    color: white;
    font-weight: 500;
}

.service-uptime {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    display: none;
}

/* Service Dropdown */
.service-status {
    position: relative;
}

.service-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.service-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.dropdown-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
}

.chat-icon {
    font-size: 20px;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.chat-username {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.stat-success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
}

.stat-danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
}

.stat-warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

/* Panel */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 12px;
}

.search-input,
.filter-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus,
.filter-select:focus {
    border-color: var(--accent-primary);
}

.panel-content {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

/* Scrollbar */
.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Servers List */
.servers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.server-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.server-item.active {
    border-color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.1);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.server-name {
    font-weight: 600;
    font-size: 16px;
}

.server-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.server-status.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.server-status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.server-status.unknown {
    background: rgba(161, 161, 170, 0.2);
    color: var(--text-secondary);
}

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

/* Server Details */
.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
}

.metric-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-fill.low {
    background: var(--success);
}

.metric-fill.medium {
    background: var(--warning);
}

.metric-fill.high {
    background: var(--danger);
}

.metric-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.additional-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.metric-badge {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}


.services-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-name {
    font-size: 14px;
    font-weight: 500;
}

.service-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.service-badge.running {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.service-badge.stopped,
.service-badge.failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Events Timeline */
.events-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-item {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.event-item:hover {
    transform: translateX(4px);
}

.event-item.critical {
    border-left-color: var(--danger);
}

.event-item.warning {
    border-left-color: var(--warning);
}

.event-item.info {
    border-left-color: var(--accent-primary);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.event-type {
    font-weight: 600;
    font-size: 14px;
}

.event-time {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.event-server {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

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

    .header h1 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
/* Server Badges */
.server-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    display: inline-block;
}

.group-badge {
    opacity: 0.9;
}

.tag-badge {
    opacity: 0.85;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Header Layout */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

.service-indicators {
    display: flex;
    gap: 12px;
}

.service-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.service-indicator .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
}

.service-indicator .status-dot.online {
    background: var(--success);
    animation: pulse 2s infinite;
}

.service-indicator .service-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}
