/* CSS Variables for theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #2563eb;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --error-color: #f87171;
    --warning-color: #fbbf24;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

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

/* Header */
.header {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: var(--accent-color);
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

/* Sections */
.section {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Log Viewer */
.log-viewer {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.log-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.log-message {
    padding: 4px 0;
    word-wrap: break-word;
}

.log-message.error {
    color: var(--error-color);
}

.log-message.warning {
    color: var(--warning-color);
}

.log-message.info {
    color: var(--text-primary);
}

.log-message.debug {
    color: var(--text-secondary);
}

/* Tool Stats */
#tool-stats-container {
    max-height: 500px;
    overflow-y: auto;
}

.stats-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.tool-stat-item {
    background-color: var(--bg-secondary);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 4px solid var(--accent-color);
}

.tool-stat-header {
    font-weight: bold;
    margin-bottom: 8px;
}

.tool-stat-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tool-stat-metric {
    display: flex;
    justify-content: space-between;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.analytics-card {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.analytics-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.analytics-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

.analytics-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.analytics-list li.placeholder {
    color: var(--text-secondary);
    justify-content: center;
}

.analytics-list li:last-child {
    border-bottom: none;
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.performance-card {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.performance-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.metric span:last-child {
    font-weight: bold;
    color: var(--accent-color);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
