* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'SF Mono', 'Consolas', monospace; 
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
}

/* Header */
.header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 15px;
}
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 24px; font-weight: 600; margin: 0; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 10px; color: #58a6ff; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; color: #f0883e; }

/* Search form */
.search-form {
    background: #0d1117;
    padding: 20px 0;
    border-bottom: 1px solid #21262d;
}
.search-form form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-form input[type="text"], .search-form input[type="number"] {
    flex: 1;
    max-width: 500px;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    font-size: 14px;
}
.search-form input[type="text"]:focus, .search-form input[type="number"]:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}
.search-form button {
    padding: 10px 16px;
    background: #238636;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.search-form button:hover { background: #2ea043; }

/* Main content */
.main-content { padding: 20px 0; }

/* Loading and error states */
.loading, .error {
    text-align: center;
    padding: 60px 20px;
    font-size: 14px;
}
.error { color: #f85149; }

/* Report sections */
.report { display: none; }
.report.active { display: block; }

.section {
    background: #161b22;
    padding: 20px 15px;
    margin-bottom: 15px;
}

/* Age distribution specific styling */
#ageDistributionChart {
    height: 500px;
}

/* Metrics grid */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}
.metric {
    background: #0d1117;
    padding: 12px;
}
.metric-label {
    color: #8b949e;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.metric-value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 5px;
    color: #58a6ff;
}

/* Charts - Taller for better visibility */
.chart-container {
    width: 100%;
    height: 600px;
}
.chart-container.strip-plot { height: 300px; }
.chart-container.timing-chart { height: 400px; }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #21262d;
}
th {
    background: #0d1117;
    font-weight: 600;
    color: #f0883e;
    position: sticky;
    top: 0;
    z-index: 10;
}
tr:hover td { background: rgba(88, 166, 255, 0.05); }

/* Hook ID styling */
.hook-id {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
}
.hook-id a {
    color: #79c0ff;
    text-decoration: none;
}
.hook-id a:hover {
    text-decoration: underline;
}

/* Creator ID styling */
.creator-id {
    color: #d2a8ff;
}

/* JSON link */
.json-link {
    margin: 20px 0;
    text-align: right;
}
.json-link a {
    color: #58a6ff;
    text-decoration: none;
    font-size: 14px;
}
.json-link a:hover { text-decoration: underline; }

/* Explanation boxes */
.explanation {
    background: #0d1117;
    padding: 12px;
    margin: 10px 0;
    font-size: 13px;
    color: #a7c8e6;
    font-weight: 500;
}

pre {
    background: #0d1117;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
}

/* Bucket feeds styling */
.bucket-feed {
    margin-bottom: 40px;
}
.bucket-hook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.bucket-hook-card {
    background: #0d1117;
    padding: 15px;
    position: relative;
}
.bucket-hook-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #161b22;
    color: #58a6ff;
    font-size: 18px;
    font-weight: bold;
    padding: 5px 10px;
    z-index: 1;
}
.bucket-hook-video {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    margin-bottom: 10px;
}
.bucket-hook-stats {
    font-size: 13px;
    line-height: 1.6;
}
.bucket-hook-stats strong {
    color: #f0f6fc;
}
.other-buckets {
    margin-top: 10px;
    font-size: 12px;
}
.bucket-tag {
    padding: 2px 6px;
    margin-left: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Carousel styles for recommendations */
.hooks-carousel-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
}
.hooks-carousel {
    display: flex;
    width: max-content;
}
.hook-card {
    flex-shrink: 0;
    width: 300px;
    padding: 12px;
}
.hook-rank {
    font-size: 24px;
    font-weight: bold;
    color: #58a6ff;
    margin-bottom: 10px;
}
.hook-video {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9/16;
    background: #000;
    margin-bottom: 10px;
}
.hook-stats {
    font-size: 14px;
    color: #8b949e;
    margin: 5px 0;
}
.hook-stats strong {
    color: #e3e3e3;
}
/* Bucket chips in carousel */
.hook-buckets {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bucket-chip {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}