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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: url('https://cdn.arstechnica.net/wp-content/uploads/2023/09/sonoma-light.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: rgba(23, 33, 43, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(14, 22, 33, 0.5);
}

.sidebar-header {
    padding: 20px;
    background: #17212b;
    border-bottom: 1px solid #0e1621;
}

.sidebar-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fff;
}

.stats {
    font-size: 14px;
    color: #8d969e;
}

.search-box {
    padding: 12px 16px;
    background: #17212b;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    background: #0e1621;
    border: none;
    border-radius: 20px;
    color: #f5f5f5;
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: #8d969e;
}

.channel-list {
    flex: 1;
    overflow-y: auto;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.channel-item:hover {
    background: #0e1621;
}

.channel-item.active {
    background: #2b5278;
}

.channel-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.channel-item.disabled:hover {
    background: transparent;
}

.channel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

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

.channel-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.channel-count {
    font-size: 13px;
    color: #8d969e;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #0e1621;
}

.btn-refresh {
    width: 100%;
    padding: 10px;
    background: #2b5278;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
}

.btn-refresh:hover {
    background: #3a6490;
}

.btn-refresh span {
    font-size: 18px;
    margin-right: 6px;
}

.last-updated {
    text-align: center;
    font-size: 12px;
    color: #8d969e;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(14, 22, 33, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chat-header {
    padding: 16px 20px;
    background: #17212b;
    border-bottom: 1px solid #0e1621;
}

.chat-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.chat-subtitle {
    font-size: 14px;
    color: #8d969e;
    margin-top: 4px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #8d969e;
}

.message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    background: #182533;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 700px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.message-author {
    font-weight: 600;
    color: #54a9eb;
    font-size: 14px;
    margin-right: 8px;
}

.message-channel {
    font-size: 12px;
    color: #8d969e;
    background: #0e1621;
    padding: 2px 8px;
    border-radius: 10px;
}

.message-content {
    color: #f5f5f5;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #8d969e;
}

.message-meta {
    display: flex;
    gap: 12px;
}

.message-time {
    display: flex;
    align-items: center;
    color: #8d969e;
    font-weight: 500;
}

.message-time::before {
    content: "📅 ";
    margin-right: 4px;
}

.message-id {
    display: flex;
    align-items: center;
    color: #6b7883;
}

.message-link {
    color: #54a9eb;
    text-decoration: none;
    font-size: 12px;
}

.message-link:hover {
    text-decoration: underline;
}

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

::-webkit-scrollbar-track {
    background: #0e1621;
}

::-webkit-scrollbar-thumb {
    background: #2b5278;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a6490;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }

    .message-bubble {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .sidebar {
        position: absolute;
        left: -320px;
        z-index: 10;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }
}

/* Highlight matching search terms */
.highlight {
    background: #ffd54f;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
}

.no-messages {
    text-align: center;
    padding: 60px 20px;
    color: #8d969e;
    font-size: 16px;
}

/* Monitor Panel */
.monitor-panel {
    width: 280px;
    background: rgba(11, 15, 22, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(26, 35, 50, 0.5);
    display: flex;
    flex-direction: column;
    font-family: 'Courier New', monospace;
}

.monitor-header {
    padding: 16px;
    background: #1a2332;
    border-bottom: 2px solid #00ff88;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.monitor-title {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #00ff88;
}

.monitor-indicator {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse 2s infinite;
}

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

.gauge-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #8d969e;
    margin-bottom: 10px;
}

.gauge {
    width: 200px;
    height: 130px;
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.3));
}

.gauge-tick {
    fill: #8d969e;
    font-size: 10px;
    font-family: 'Courier New', monospace;
}

#gauge-needle {
    transform-origin: 100px 110px;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#gauge-progress {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-reading {
    margin-top: 10px;
    text-align: center;
}

.gauge-value {
    font-size: 32px;
    font-weight: bold;
    color: #00ff88;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.gauge-unit {
    font-size: 11px;
    color: #8d969e;
    margin-top: 4px;
    letter-spacing: 1px;
}

.monitor-stats {
    padding: 20px;
    border-top: 1px solid #1a2332;
    flex: 1;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px;
    background: #151b24;
    border-left: 2px solid #2b5278;
}

.stat-label {
    font-size: 10px;
    color: #8d969e;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 12px;
    color: #00ff88;
    font-weight: bold;
}

/* Bar Graph Container */
.bar-graph-container {
    padding: 20px;
    border-top: 1px solid #1a2332;
}

.bar-graph-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #8d969e;
    margin-bottom: 10px;
}

.bar-graph-channel {
    margin-bottom: 15px;
}

.bar-graph-channel:last-child {
    margin-bottom: 0;
}

.bar-graph {
    width: 100%;
    height: 80px;
}

.bar-label {
    fill: #8d969e;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Segment colors */
.segment-empty {
    fill: #3a4556;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-data {
    fill: #00ff88;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-gap-bluetruth {
    fill: #9b59b6;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.segment-gap-rellen5 {
    fill: #ff69b4;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Legacy bar fills (kept for backwards compatibility) */
.bar-fill-bluetruth {
    fill: #9b59b6;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill-rellen5 {
    fill: #ff69b4;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-text {
    fill: #f5f5f5;
    font-size: 9px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.bar-tick {
    fill: #8d969e;
    font-size: 9px;
    font-family: 'Courier New', monospace;
}

.bar-tick-label {
    fill: #6b7883;
    font-size: 8px;
    font-family: 'Courier New', monospace;
}

/* Graph Container */
.graph-container {
    padding: 20px;
    border-top: 1px solid #1a2332;
}

.graph-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #8d969e;
    margin-bottom: 10px;
}

.line-graph {
    width: 100%;
    height: 100px;
    filter: drop-shadow(0 0 5px rgba(0, 255, 136, 0.2));
}

.graph-tick {
    fill: #8d969e;
    font-size: 8px;
    font-family: 'Courier New', monospace;
}

#data-line {
    filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.5));
}

.graph-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1a2332;
}

.graph-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.graph-stat-label {
    font-size: 9px;
    color: #8d969e;
    letter-spacing: 1px;
}

.graph-stat-value {
    font-size: 11px;
    color: #00ff88;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 1200px) {
    .monitor-panel {
        display: none;
    }
}
