@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --border-color: #2a2a3a;
    --border-glow: #3a3a5a;
    
    --text-primary: #e8e8ed;
    --text-secondary: #9898a8;
    --text-muted: #585868;
    
    --accent-cyan: #00f5ff;
    --accent-cyan-dim: #00a5aa;
    --accent-purple: #a855f7;
    --accent-green: #10ff88;
    --accent-amber: #ffaa00;
    --accent-red: #ff4757;
    
    --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.3);
    --glow-purple: 0 0 20px rgba(168, 85, 247, 0.3);
    
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Space Grotesk', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 245, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 245, 255, 0.01) 2px,
            rgba(0, 245, 255, 0.01) 4px
        );
    pointer-events: none;
    z-index: -1;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-cyan));
    animation: borderGlow 3s ease infinite;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--glow-cyan);
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-cyan-dim));
    color: var(--bg-primary);
    border: none;
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
}

.btn-danger {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.slider::before {
    position: absolute;
    content: '';
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text-secondary);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

input:checked + .slider::before {
    transform: translateX(24px);
    background: var(--bg-primary);
}

.switch-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-cyan);
    opacity: 0.5;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.stat-card:nth-child(2)::before {
    background: var(--accent-purple);
}
.stat-card:nth-child(2):hover {
    border-color: var(--accent-purple);
    box-shadow: var(--glow-purple);
}

.stat-card:nth-child(3)::before {
    background: var(--accent-green);
}
.stat-card:nth-child(3):hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(16, 255, 136, 0.3);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card:nth-child(2) .stat-value {
    color: var(--accent-purple);
}

.stat-card:nth-child(3) .stat-value {
    color: var(--accent-green);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.filters select,
.filters input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 180px;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.filters input {
    flex: 1;
    min-width: 250px;
}

.filters select option {
    background: var(--bg-secondary);
}

.logs-container {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.logs-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
}

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
}

td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    vertical-align: middle;
}

tbody tr {
    transition: all 0.15s ease;
}

tbody tr:hover {
    background: rgba(0, 245, 255, 0.03);
}

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

.timestamp {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge.debug { 
    background: rgba(104, 104, 124, 0.2); 
    color: #8888a0;
    border-color: rgba(104, 104, 124, 0.3);
}
.badge.info { 
    background: rgba(0, 245, 255, 0.1); 
    color: var(--accent-cyan);
    border-color: rgba(0, 245, 255, 0.3);
}
.badge.warning { 
    background: rgba(255, 170, 0, 0.1); 
    color: var(--accent-amber);
    border-color: rgba(255, 170, 0, 0.3);
}
.badge.error { 
    background: rgba(255, 71, 87, 0.1); 
    color: var(--accent-red);
    border-color: rgba(255, 71, 87, 0.3);
}
.badge.success { 
    background: rgba(16, 255, 136, 0.1); 
    color: var(--accent-green);
    border-color: rgba(16, 255, 136, 0.3);
}

.shop-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.operation-tag {
    font-size: 0.75rem;
    color: var(--accent-purple);
}

.message-cell {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.level-error {
    background: rgba(255, 71, 87, 0.05);
}
.level-warning {
    background: rgba(255, 170, 0, 0.05);
}
.level-success {
    background: rgba(16, 255, 136, 0.05);
}

.loading, .empty, .error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty::before {
    content: '📭';
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.error {
    color: var(--accent-red);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filters select,
    .filters input {
        width: 100%;
        min-width: unset;
    }
    
    th, td {
        padding: 0.75rem;
    }
    
    .message-cell {
        max-width: 200px;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
}
