/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-dark: #0f0f14;
    --bg-card: #1a1a24;
    --bg-sidebar: #13131a;
    --border: #2a2a3a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --orange: #f97316;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.logo .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.nav-menu {
    list-style: none;
    margin-top: 32px;
    flex: 1;
}

.nav-menu li { margin-bottom: 4px; }

.nav-menu a {
    display: block;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-menu a.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
}

.nav-footer {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.nav-footer .update-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Main Content ===== */
.content {
    margin-left: 240px;
    padding: 32px 40px;
    flex: 1;
    max-width: 1200px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header .page-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Cards Grid ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--accent);
}

.card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-body h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.card-body p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Section ===== */
.section {
    margin-bottom: 32px;
}

.section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px;
    text-align: center;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* ===== Insights List ===== */
.insights-list .insight-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insight-item .insight-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.tag-pattern { background: rgba(99, 102, 241, 0.2); color: var(--accent); }
.tag-trend { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.tag-idea { background: rgba(249, 115, 22, 0.2); color: var(--orange); }
.tag-warning { background: rgba(239, 68, 68, 0.2); color: var(--red); }

.insight-item .insight-text {
    font-size: 14px;
    flex: 1;
}

.insight-item .insight-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== Video Grid ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.video-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.video-card .thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.video-card .video-info {
    padding: 12px 16px;
}

.video-card .video-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .video-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.video-card .video-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.video-card .video-stats .stat-value {
    color: var(--green);
    font-weight: 600;
}

/* ===== Channel List ===== */
.channel-table {
    width: 100%;
    border-collapse: collapse;
}

.channel-table th,
.channel-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.channel-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-table tr:hover td {
    background: rgba(99, 102, 241, 0.05);
}

.channel-name {
    font-weight: 600;
    color: var(--accent);
}

/* ===== Pattern Grid ===== */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pattern-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
}

.pattern-card .pattern-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pattern-card .pattern-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pattern-card .pattern-confidence {
    font-size: 11px;
    color: var(--text-muted);
}

.confidence-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.confidence-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

/* ===== Trend Timeline ===== */
.trend-timeline .trend-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.trend-item .trend-date {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 80px;
    font-family: var(--font-mono);
}

.trend-item .trend-content {
    font-size: 14px;
    flex: 1;
}

.trend-item .trend-direction {
    font-size: 12px;
    font-weight: 600;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-new { color: var(--yellow); }

/* ===== Tools Page ===== */
.tool-category {
    margin-bottom: 24px;
}

.tool-category h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.tool-card .tool-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.tool-card .tool-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tool-card .tool-price {
    font-size: 12px;
    color: var(--green);
    font-weight: 600;
}

/* ===== Ideas Page ===== */
.idea-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.idea-status {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-proposed { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.status-approved { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.status-completed { background: rgba(99, 102, 241, 0.2); color: var(--accent); }

.idea-content { flex: 1; }

.idea-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.idea-reason {
    font-size: 12px;
    color: var(--text-secondary);
}

.idea-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    min-width: 40px;
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { margin-left: 0; padding: 16px; }
    .cards-grid { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: 1fr; }
    .pattern-grid { grid-template-columns: 1fr; }
}
