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

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-color: #334155;
    --card-bg: #1e293b;
    --card-hover: #334155;
}

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

h1 {
    color: var(--text-primary);
    text-align: left;
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.5px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* Left Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 20px;
}

.sidebar-item {
    padding: 12px 20px;
}

.sidebar-label {
    display: block;
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875em;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-select:hover {
    border-color: var(--accent-primary);
}

.sidebar-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.sidebar-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.9375em;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-left-color: var(--accent-primary);
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Header (fixed at top) */
.header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background: var(--card-bg);
    border-radius: 0;
    padding: 16px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 100;
    height: 72px;
}

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

.header-title {
    font-size: 1.25em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mobile-menu-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
}

/* Main content area with sidebar */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    padding-left: 250px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.server-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.server-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.server-name {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.server-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.server-name a:hover {
    color: var(--accent-primary);
}

.server-address {
    color: var(--text-muted);
    font-size: 0.875em;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    text-align: left;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.stat-label {
    color: var(--text-muted);
    font-size: 0.75em;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

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

.chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 20px;
}

.chart-small {
    height: 100px;
}

.uptime-bar {
    height: 32px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid var(--border-color);
}

.uptime-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875em;
    width: 0%;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12px, 1fr));
    gap: 4px;
    margin: 15px 0;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.history-grid.collapsed {
    max-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.history-toggle {
    text-align: center;
    margin-top: 8px;
    cursor: pointer;
    color: #667eea;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    user-select: none;
}

.history-toggle:hover {
    color: #764ba2;
    transform: scale(1.05);
}

.history-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}



.stats-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-top: 12px;
}

.stat-value-small {
    font-size: 0.95em;
}

.chart-container-tall {
    height: 220px;
}

.heatmap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    overflow-x: auto;
}

.heatmap-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: center;
    gap: 8px;
}

.heatmap-date {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.heatmap-cells {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    min-width: fit-content;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.heatmap-cell:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
}

.heatmap-cell.selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.history-block {
    height: 12px;
    border-radius: 3px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.history-block:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.history-block.online {
    background: #10b981;
}

.history-block.offline {
    background: #ef4444;
}

.history-block.unknown {
    background: #d1d5db;
}

.update-time {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75em;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* 工具栏 */
.toolbar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

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

.toolbar-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn:hover {
    background: #2563eb;
}

.toolbar-btn:active {
    transform: scale(0.98);
}

.toolbar-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875em;
}

/* WebSocket 状态指示器 */
.ws-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: help;
    white-space: nowrap;
}

.ws-connecting {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.ws-connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ws-disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ws-error {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

@keyframes pulse-connect {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
}.loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1em;
    font-weight: 500;
    padding: 40px 20px;
}

.motd {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title:first-of-type {
    margin-top: 0;
}

/* 美化全局时间跨度下拉框 */
.range-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875em;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.range-select:hover {
    border-color: var(--accent-primary);
}

.range-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.range-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

.group-servers {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.group-servers a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.group-servers a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.info-list, .player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875em;
    color: var(--text-secondary);
}

.info-line:last-child {
    border-bottom: none;
}

.player-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.player-row:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.player-meta {
    font-size: 0.875em;
    color: var(--text-muted);
    text-align: right;
}

/* Players List Page */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-card-compact {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.player-card-compact:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
    transform: translateX(4px);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-heatmap-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.player-name-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.player-name-status .player-name {
    font-size: 1.1em;
}

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

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

.status-dot.offline {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.player-stats-row {
    display: flex;
    gap: 16px;
    font-size: 0.875em;
    color: var(--text-secondary);
}

.stat-item {
    white-space: nowrap;
}

.player-heatmap {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    width: 100%;
}

.player-heatmap-container .player-heatmap {
    width: 300px;
    display: grid;
    grid-template-columns: repeat(24, 1fr);
}

/* Ensure heatmap in detail page stays full width */
#heatmap-24h {
    width: 100%;
}

.heatmap-block {
    height: 24px;
    border-radius: 2px;
    transition: transform 0.2s ease;
}

.player-heatmap-container .heatmap-block {
    aspect-ratio: auto;
    height: 20px;
}

.heatmap-block.intensity-none {
    background: var(--bg-tertiary);
    opacity: 0.3;
}

.heatmap-block.intensity-low {
    background: var(--success);
    opacity: 0.3;
}

.heatmap-block.intensity-medium {
    background: var(--success);
    opacity: 0.6;
}

.heatmap-block.intensity-high {
    background: var(--success);
    opacity: 1;
}

.heatmap-block:hover {
    transform: scale(1.2);
    z-index: 10;
}

.player-heatmap-empty {
    width: 300px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75em;
}

/* 分钟级热力图样式 */
.minute-heatmap-container {
    overflow-x: auto;
}

.minute-heatmap-wrapper {
    display: inline-block;
    min-width: 100%;
}

.minute-heatmap-row {
    display: flex;
    align-items: center;
    margin: 2px 0;
}

.minute-heatmap-label {
    width: 40px;
    text-align: right;
    padding-right: 8px;
    font-size: 0.85em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.minute-heatmap-blocks {
    display: grid;
    gap: 2px;
    flex: 1;
}

.minute-block {
    aspect-ratio: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.minute-block.intensity-none {
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.minute-block.intensity-low {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.minute-block.intensity-medium {
    background: rgba(59, 130, 246, 0.6);
    border: 1px solid rgba(59, 130, 246, 0.7);
}

.minute-block.intensity-high {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 1);
}

.minute-block:hover {
    transform: scaleY(1.3);
    z-index: 1;
}

.minute-block.selected {
    outline: 2px solid var(--accent-primary);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Online count heatmap styles */
.online-count-chart-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.minute-heatmap-hint {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-muted);
}



/* 响应式设计 - 移动设备优化 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        padding: 12px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    body {
        padding-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .container {
        padding-top: 80px;
    }

    .header {
        left: 0;
        padding: 12px;
        flex-wrap: nowrap;
        height: 60px;
    }

    .header-left {
        flex: 1;
        justify-content: flex-start;
        gap: 8px;
    }

    .header-right {
        flex: 1;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-link {
        padding: 12px 20px;
    }

    /* Hide time range selector on mobile by default */
    .header-right .range-select,
    .header-right .toolbar-label:has(+ .range-select) {
        display: none;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .toolbar-btn {
        flex: 1 1 auto;
        min-width: 100px;
        padding: 8px 16px;
        font-size: 0.875em;
    }

    .toolbar-label {
        font-size: 0.875em;
    }

    .range-select {
        width: 100%;
        margin: 8px 0 0 0;
    }

    .server-card {
        padding: 16px;
    }

    .server-name {
        font-size: 1.25em;
    }

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

    .stat-value {
        font-size: 1.5em;
    }

    .heatmap-row {
        grid-template-columns: 70px 1fr;
    }

    .heatmap-cells {
        gap: 1px;
        min-width: 300px;
    }

    .heatmap-cell {
        height: 80%; /* 80% of default 20px = 16px */
    }

    .ws-status {
        font-size: 0.75em;
        padding: 6px 10px;
    }

    .chart-title {
        font-size: 1em;
    }

    .player-card-compact {
        flex-direction: column;
        align-items: stretch;
    }

    .player-heatmap-container {
        width: 100%;
    }

    .player-heatmap {
        width: 100%;
        max-width: none;
    }

    .player-heatmap-container .player-heatmap {
        width: 100%;
        min-width: auto;
        max-width: none;
    }

    .player-heatmap-empty {
        width: 100%;
    }

    .player-stats-row {
        flex-direction: column;
        gap: 4px;
    }

    /* 节点延迟统计移动端优化 */
    .info-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }

    .info-line > span:last-child {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 12px !important;
        font-size: 0.8em !important;
    }

    .info-line > span:last-child > span {
        min-width: auto !important;
        text-align: left !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 24h Heatmap for Server/Nodes */
.heatmap-24h-container {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    width: 100%;
    margin: 12px 0;
}

.heatmap-24h-block {
    height: 24px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.heatmap-24h-block:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.heatmap-24h-block.status-online {
    background: #10b981;
}

.heatmap-24h-block.status-partial {
    background: #f59e0b;
}

.heatmap-24h-block.status-offline {
    background: #ef4444;
}

.heatmap-24h-block.status-none {
    background: var(--bg-tertiary);
    opacity: 0.3;
}

/* Hour Detail Modal/Popup */
.hour-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    z-index: 2000;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.hour-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
}

.hour-detail-header {
    font-size: 1.125em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hour-detail-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hour-detail-close:hover {
    color: var(--text-primary);
}

/* Dropdown-style popup */
.hour-detail-popup {
    position: absolute;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    z-index: 2000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    max-width: calc(30 * 12px + 30px + 24px);
    max-height: 500px;
    overflow-y: auto;
}

.hour-detail-header-popup {
    font-size: 0.875em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.data-points-grid-popup {
    display: grid;
    grid-template-columns: repeat(30, 12px);
    gap: 1px;
}

.data-point {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.75em;
    text-align: center;
    padding: 4px;
    color: var(--text-primary);
    position: relative;
}

.data-point:hover {
    transform: scale(1.1);
    z-index: 10;
}

.data-point-small {
    width: 10px;
    height: 10px;
    border-radius: 1px;
    cursor: pointer;
    transition: transform 0.2s ease;
    opacity: 0.9;
}

.data-point-small:hover {
    transform: scale(1.5);
    z-index: 10;
    opacity: 1;
}

/* Status colors for data points */
.data-point-small[data-status="online"] {
    background: #10b981;
}

.data-point-small[data-status="offline"] {
    background: #ef4444;
}

.data-point-small[data-status="partial"] {
    background: #f59e0b;
}

.data-point-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    white-space: nowrap;
    margin-bottom: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.data-point:hover .data-point-tooltip {
    opacity: 1;
}
