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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa; /* 70% - neutral background */
    min-height: 100vh;
    padding: 0;
    color: #1a1a1a;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 1px rgba(0,0,0,0.1);
}

/* Header */
header {
    background: white;
    color: #1a1a1a;
    padding: 40px 40px 20px;
    border-bottom: 1px solid #e5e5e5;
}

header h1 {
    font-size: 1.75em;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

header p {
    font-size: 0.95em;
    color: #666;
    font-weight: 400;
}

/* Navigation */
nav {
    display: flex;
    background: white;
    padding: 0 40px;
    gap: 24px;
}

nav a {
    padding: 12px 0;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
}

nav a:hover {
    color: #1a1a1a;
}

nav a.active {
    color: #4f46e5; /* 20% - brand color */
    border-bottom-color: #4f46e5;
}

/* Messages */
.messages {
    padding: 16px 40px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9em;
    border-left: 3px solid;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

/* Upload Section */
.upload-section {
    padding: 32px 40px;
}

.upload-section h2 {
    color: #1a1a1a;
    margin-bottom: 24px;
    font-size: 1.25em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-weight: 500;
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
    background: white;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4f46e5; /* 20% - brand color */
}

.btn-primary {
    background: #10b981; /* 10% - action color */
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #059669;
}

/* Info Section */
.info-section {
    background: #f9fafb;
    padding: 20px 40px 32px;
    margin-top: 40px;
    border-top: 1px solid #e5e5e5;
}

.info-section h3 {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-section ol {
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.5;
    font-size: 0.9em;
}

/* Results Section */
.results-section {
    padding: 32px 40px;
}

.results-section h2 {
    color: #1a1a1a;
    margin-bottom: 24px;
    font-size: 1.25em;
    font-weight: 600;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fafafa; /* 70% - background */
    border: 1px solid #e5e5e5;
    padding: 24px 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5em;
    margin-bottom: 8px;
    color: #4f46e5; /* 20% - brand color */
    font-weight: 700;
}

.stat-card p {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

/* Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9em;
}

.results-table thead {
    background: #fafafa;
    border-bottom: 1.5px solid #e5e5e5;
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: left;
}

.results-table th {
    color: #666;
    font-weight: 500;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.results-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.results-table tbody tr:hover {
    background: #fafafa;
}

.room-badge {
    background: #eef2ff; /* 20% - brand tint */
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.count-badge {
    background: #10b981; /* 10% - action color */
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1em;
}

.path-cell {
    font-size: 0.8em;
    color: #999;
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* No Data */
.no-data {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-data p {
    font-size: 1.1em;
    margin-bottom: 24px;
    color: #666;
}

/* API Info */
.api-info {
    background: #f9fafb;
    padding: 20px 40px 32px;
    margin-top: 40px;
    border-top: 1px solid #e5e5e5;
}

.api-info h3 {
    color: #666;
    margin-bottom: 12px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-info ul {
    list-style: none;
}

.api-info li {
    margin-bottom: 8px;
    color: #666;
    font-size: 0.9em;
}

.api-info code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', monospace;
    color: #4f46e5; /* 20% - brand color */
    font-weight: 500;
    font-size: 0.85em;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 24px 20px 16px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    nav {
        padding: 0 20px;
    }
    
    .upload-section,
    .results-section,
    .info-section,
    .api-info {
        padding: 24px 20px;
    }
    
    .results-table {
        font-size: 0.85em;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 12px;
    }
}

/* Monitor Section */
.monitor-section {
    padding: 32px 40px;
}

.monitor-section h2 {
    color: #1a1a1a;
    margin-bottom: 24px;
    font-size: 1.25em;
    font-weight: 600;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.monitor-card {
    background: white;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.monitor-card:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

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

.room-header h3 {
    color: #1a1a1a;
    font-size: 1em;
    font-weight: 600;
    margin: 0;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

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

.count-display {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.count-number {
    display: block;
    font-size: 3.5em;
    font-weight: 700;
    color: #4f46e5;
    line-height: 1;
    margin-bottom: 8px;
}

.count-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.last-updated {
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

@media (max-width: 768px) {
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .monitor-section {
        padding: 24px 20px;
    }
}
