:root {
    --bg-dark: #0a0a0a;
    --panel-bg: #141414;
    --primary: #00ff88;
    --primary-dim: rgba(0, 255, 136, 0.2);
    --secondary-blue: #4da6ff;
    --secondary-orange: #ffaa33;
    --secondary-red: #ff4466;
    --text-main: #f0f0f0;
    --text-muted: #888888;
    
    --agent-research: #00ff88;
    --agent-creator: #4da6ff;
    --agent-produce: #ffaa33;
    --agent-editor: #ff88ff;
    --agent-validator: #88ffcc;
    --agent-schedule: #ff6644;

    --fb-color: #1877f2;
    --tt-color: #333333;
    --yt-color: #ff0000;

    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    padding: 20px;
}

.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 40px);
}

.panel {
    background-color: var(--panel-bg);
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0,255,136,0.05);
}

.panel-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 40px;
    width: auto;
}

.title {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: var(--primary);
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    background: #1a1a1a;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #333;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--secondary-red);
    box-shadow: 0 0 8px var(--secondary-red);
}

.status-dot.active {
    background-color: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-start {
    border-color: rgba(0, 255, 136, 0.5);
    color: var(--primary);
}
.btn-start:hover {
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.btn-stop {
    border-color: rgba(255, 68, 102, 0.5);
    color: var(--secondary-red);
}
.btn-stop:hover {
    background: rgba(255, 68, 102, 0.1);
    box-shadow: 0 0 10px rgba(255, 68, 102, 0.2);
}

.btn-trigger {
    border-color: rgba(77, 166, 255, 0.6);
    color: var(--secondary-blue);
    background: rgba(77, 166, 255, 0.05);
}

.btn-trigger:hover {
    background: var(--secondary-blue);
    color: #000;
    box-shadow: 0 0 12px rgba(77, 166, 255, 0.4);
}

.time-display {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-muted);
}

/* MAIN GRID */
.main-grid {
    display: grid;
    grid-template-columns: 60% 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* LOGS */
.logs-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logs-container {
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logs-container::-webkit-scrollbar { width: 6px; }
.logs-container::-webkit-scrollbar-track { background: #111; }
.logs-container::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.log-entry {
    display: flex;
    gap: 12px;
    animation: slideInFade 0.3s ease-out forwards;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
}

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

@keyframes slideInFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-time { color: var(--text-muted); min-width: 80px; }
.log-agent { font-weight: 600; min-width: 120px; }
.log-arrow { color: #555; }
.log-msg { color: #ccc; flex: 1; word-break: break-word; }

/* RIGHT COLUMN */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.monetization-panel {
    display: flex;
    flex-direction: column;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prog-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prog-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.prog-platform { display: flex; align-items: center; gap: 6px; }
.prog-stats { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.prog-pct { font-weight: 600; }

.prog-bar-bg {
    height: 8px;
    background: #222;
    border-radius: 4px;
    overflow: hidden;
}

.prog-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* STATS */
.stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.stats-header .panel-title {
    margin-bottom: 0;
}

.stats-tabs {
    display: flex;
    gap: 6px;
    background: #0d0d0d;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid #222;
}

.stats-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.stats-tab.active {
    background: #222;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: #1a1a1a;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #2a2a2a;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

.stat-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-val {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

/* PIPELINE */
.pipeline-panel {
    min-height: 160px;
}

.pipeline-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pipeline-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.pipe-info {
    width: 250px;
    flex-shrink: 0;
}

.pipe-title-kh {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pipe-title-en {
    font-size: 12px;
    color: var(--text-muted);
}

.pipe-stages {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.pipe-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #333;
    z-index: 1;
    transform: translateY(-50%);
}

.pipe-line-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 1s ease;
}

.stage {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    padding: 0 10px;
}

.stage-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s;
}

.stage-label {
    font-size: 10px;
    font-family: var(--font-mono);
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
}

.stage.completed .stage-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.stage.completed .stage-label {
    color: var(--primary);
}

.stage.active .stage-dot {
    border-color: var(--primary);
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    animation: pulse 2s infinite;
}

.stage.active .stage-label {
    color: #fff;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .logs-panel {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .pipeline-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .pipe-stages {
        width: 100%;
        margin-top: 20px;
    }
}
