/* ============================================
   Professional Developer Monitoring Dashboard
   Dark Theme, Clean, Data-Focused Design
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --text-primary: #e1e8ed;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --border-color: #2d3748;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #0ea5e9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    letter-spacing: 0.3px;
}

/* === Header === */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 24px;
}

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

.logo h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.logo p {
    font-size: 12px;
    color: var(--text-tertiary);
}

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

.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

/* === Section === */
section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* === Grid Layout === */
.grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.grid.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* === Stat Card === */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
}

.stat-change.positive {
    color: var(--status-success);
}

.stat-change.negative {
    color: var(--status-danger);
}

/* === Card === */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.card-body {
    padding: 20px;
}

/* === Badge === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--status-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--status-info);
}

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

.status-dot.active {
    background: var(--status-success);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.inactive {
    background: var(--status-danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === Queue Status Blocks === */
.queue-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.queue-stat {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.queue-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.queue-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'Courier New', monospace;
}

/* === Table === */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* === Progress Bar === */
.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

/* === Status Indicator === */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-indicator.success {
    color: var(--status-success);
}

.status-indicator.warning {
    color: var(--status-warning);
}

.status-indicator.danger {
    color: var(--status-danger);
}

.status-indicator.info {
    color: var(--status-info);
}

/* === Info Block === */
.info-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

/* === Loading === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .container {
        padding: 24px;
    }

    .grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .header-content {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 16px;
    }

    .header {
        padding: 16px;
    }

    .grid {
        grid-template-columns: 1fr !important;
    }

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

    th, td {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* === Hidden Classes === */
.hidden {
    display: none !important;
}
