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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #f8f9fc 0%, #e8eef5 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: #1a1f36;
    margin-bottom: 10px;
}

.subtitle {
    color: #697386;
    font-size: 1rem;
    margin-bottom: 15px;
}

.back-link {
    display: inline-block;
    color: #5469d4;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.back-link:hover {
    background-color: rgba(84, 105, 212, 0.1);
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e3e8ee;
    background: white;
    color: #697386;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #5469d4;
    color: #5469d4;
}

.filter-btn.active {
    background: #5469d4;
    color: white;
    border-color: #5469d4;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #697386;
    font-weight: 500;
}

.auto-refresh input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.clear-btn,
.download-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn {
    background: #ff6b6b;
    color: white;
}

.clear-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.download-btn {
    background: #5469d4;
    color: white;
}

.download-btn:hover {
    background: #4355c8;
    transform: translateY(-1px);
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e3e8ee;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #5469d4;
}

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

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #697386;
    font-weight: 500;
}

.stat-value {
    color: #1a1f36;
    font-weight: 700;
    font-size: 1.2rem;
}

.stat-error {
    color: #ff6b6b;
}

.stat-warning {
    color: #ffa502;
}

.logs-container {
    background: #1a1f36;
    border-radius: 12px;
    padding: 20px;
    min-height: 500px;
    max-height: 700px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

.log-line {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    transition: background-color 0.2s;
}

.log-line:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.log-line.hidden {
    display: none;
}

.log-timestamp {
    color: #a0aec0;
    font-weight: 600;
}

.log-level {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 8px;
}

.log-level-DEBUG {
    background: #4a5568;
    color: #cbd5e0;
}

.log-level-INFO {
    background: #3182ce;
    color: white;
}

.log-level-WARNING {
    background: #ffa502;
    color: white;
}

.log-level-ERROR {
    background: #ff6b6b;
    color: white;
}

.log-level-CRITICAL {
    background: #c53030;
    color: white;
}

.log-function {
    color: #9f7aea;
    font-weight: 600;
}

.log-message {
    color: #e2e8f0;
}

.log-line.highlight {
    background-color: rgba(255, 235, 59, 0.2);
}

/* Scrollbar customization */
.logs-container::-webkit-scrollbar {
    width: 10px;
}

.logs-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #697386;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .filter-buttons {
        justify-content: center;
    }

    .action-buttons {
        justify-content: center;
    }

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

    .logs-container {
        font-size: 0.8rem;
        padding: 15px;
    }
}
