:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #2f81f7;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --border: #30363d;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    padding: 2rem;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cams-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    border-color: #484f58;
}

.card-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
}

.card-header.border-bottom {
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.live-badge {
    background-color: rgba(248, 81, 73, 0.15);
    color: var(--danger);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.live-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: var(--danger);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

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

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Simulated AI overlays elements */
.ai-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bounding-box {
    position: absolute;
    border: 2px solid var(--success);
    background: rgba(63, 185, 80, 0.1);
}

.bounding-box::after {
    content: 'Vehicle 98%';
    position: absolute;
    top: -20px;
    left: -2px;
    background: var(--success);
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
}

.ai-card {
    display: flex;
    flex-direction: column;
}

.ai-icon {
    color: var(--accent);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-indicator.active {
    background-color: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: slow-pulse 3s infinite;
}

@keyframes slow-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.ai-content {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

@media (max-width: 992px) {
    .ai-content {
        grid-template-columns: 1fr;
    }
    .cams-container {
        grid-template-columns: 1fr;
    }
}

.ai-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.metric-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.metric-box:hover {
    background: rgba(47, 129, 247, 0.05);
    border-color: #484f58;
}

.metric-box.full-width {
    grid-column: 1 / -1;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.text-green { color: var(--success); }
.text-yellow { color: var(--warning); }
.text-red { color: var(--danger); }
.text-accent { color: var(--accent); }

.ai-logs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ai-logs h3 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.log-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.log-list::-webkit-scrollbar {
    width: 6px;
}
.log-list::-webkit-scrollbar-track {
    background: #0d1117;
    border-radius: 8px;
}
.log-list::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 8px;
}
.log-list::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.log-list li {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

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

.log-list .time {
    color: #a5d6ff;
    flex-shrink: 0;
    opacity: 0.8;
}

.log-list .message {
    color: #c9d1d9;
    line-height: 1.4;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

.tag-ct09 { background: rgba(47, 129, 247, 0.2); color: #79c0ff; }
.tag-ct10 { background: rgba(210, 153, 34, 0.2); color: #e3b341; }
.tag-system { background: rgba(63, 185, 80, 0.2); color: #56d364; }

/* Animations for new logs */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-list li.new {
    animation: slideIn 0.3s ease-out forwards;
}
