/* Ultra-Premium Design System */
:root {
    /* Colors - Premium Dark Theme */
    --bg-primary: #0a0e14;
    --bg-secondary: #0d1117;
    --bg-tertiary: #161b22;
    --bg-elevated: #1c2128;
    --bg-overlay: #22272e;
    
    --border-primary: #30363d;
    --border-secondary: #21262d;
    --border-hover: #484f58;
    
    --text-primary: #f0f6fc;
    --text-secondary: #c9d1d9;
    --text-tertiary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-yellow: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    --accent-cyan: #39d0d8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #3fb950 0%, #238636 100%);
    --gradient-warning: linear-gradient(135deg, #d29922 0%, #bb8009 100%);
    --gradient-danger: linear-gradient(135deg, #f85149 0%, #da3633 100%);
    --gradient-info: linear-gradient(135deg, #58a6ff 0%, #1f6feb 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.3);
    
    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: radial-gradient(circle at 50% 0%, rgba(88, 166, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    color: var(--accent-blue);
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.4));
}

.brand-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-info);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-badge {
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.nav-link.active {
    color: var(--accent-blue);
    background: var(--bg-elevated);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 8px;
    color: #58a6ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: #58a6ff;
    transform: translateY(-1px);
}

.btn-login svg {
    width: 18px;
    height: 18px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: 8px;
    color: #f85149;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(248, 81, 73, 0.2);
    border-color: #f85149;
    transform: translateY(-1px);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
    position: relative;
    z-index: 1;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.header-text h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    color: var(--text-tertiary);
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-overlay);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 20px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.stat-primary::before {
    background: var(--gradient-info);
}

.stat-card.stat-success::before {
    background: var(--gradient-success);
}

.stat-card.stat-warning::before {
    background: var(--gradient-warning);
}

.stat-card.stat-info::before {
    background: var(--gradient-primary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-blue);
}

.stat-success .stat-icon {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.stat-warning .stat-icon {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-yellow);
}

.stat-info .stat-icon {
    background: rgba(188, 140, 255, 0.15);
    color: var(--accent-purple);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.stat-trend.positive {
    color: var(--accent-green);
}

.stat-trend.neutral {
    color: var(--text-tertiary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.chart-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.chart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-select {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-select:hover {
    border-color: var(--border-hover);
}

.chart-content {
    padding: 24px;
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.status-online {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

/* Status Info */
.status-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

/* Log List */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.log-list::-webkit-scrollbar {
    width: 8px;
}

.log-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.log-list::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

.log-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-left: 3px solid var(--border-primary);
    border-radius: 6px;
    transition: all var(--transition-fast);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.log-item:hover {
    background: var(--bg-overlay);
    transform: translateX(2px);
}

.log-item.log-error {
    border-left-color: var(--accent-red);
    background: rgba(248, 81, 73, 0.05);
}

.log-item.log-warning {
    border-left-color: var(--accent-yellow);
    background: rgba(210, 153, 34, 0.05);
}

.log-item.log-info {
    border-left-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.05);
}

.log-item.log-debug {
    border-left-color: var(--accent-purple);
    background: rgba(188, 140, 255, 0.05);
}

.log-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.log-error .log-icon {
    color: var(--accent-red);
}

.log-warning .log-icon {
    color: var(--accent-yellow);
}

.log-info .log-icon {
    color: var(--accent-blue);
}

.log-debug .log-icon {
    color: var(--accent-purple);
}

.log-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.log-message {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

/* Server Section */
.server-section {
    margin-top: 32px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-description {
    color: var(--text-tertiary);
    font-size: 14px;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.server-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-info);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.server-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.server-card:hover::before {
    transform: scaleX(1);
}

.server-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.server-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.server-info {
    flex: 1;
}

.server-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.server-id {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
}

.server-stats {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.server-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.server-stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Notification */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transition: top var(--transition-base);
    max-width: 500px;
    border: 1px solid;
}

.notification.show {
    top: 24px;
}

.notification.success {
    background: var(--bg-tertiary);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.notification.error {
    background: var(--bg-tertiary);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Loading Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--border-primary);
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.btn-primary {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #4a8fd9;
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .nav-container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
}
