:root {
    --hotlist-primary: var(--cm-color-accent);
    --hotlist-primary-light: var(--cm-color-accent-text);
    --hotlist-secondary: var(--cm-color-text-primary);
    --hotlist-accent: var(--cm-color-accent-text);
    --hotlist-success: var(--cm-color-positive);
    --hotlist-danger: var(--cm-color-critical);
    --hotlist-bg: var(--cm-color-canvas);
    --hotlist-surface: var(--cm-color-surface);
    --hotlist-surface-light: var(--cm-color-surface-raised);
    --hotlist-text: var(--cm-color-text-primary);
    --hotlist-text-muted: var(--cm-color-text-secondary);
    --hotlist-border: var(--cm-color-outline);
    --hotlist-gradient: var(--cm-color-accent);
    --hotlist-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --hotlist-glass: var(--cm-color-surface-glass-tint);
    --hotlist-blur: blur(10px);
}

/* App Container */
.hotlist-app {
    min-height: 100vh;
    background: var(--hotlist-bg);
    color: var(--hotlist-text);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--hotlist-glass);
    backdrop-filter: var(--hotlist-blur);
    -webkit-backdrop-filter: var(--hotlist-blur);
    border-bottom: 1px solid var(--hotlist-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--hotlist-text);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--hotlist-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--hotlist-text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--hotlist-primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.header-actions button,
.header-actions a {
    background: transparent;
    border: none;
    color: var(--hotlist-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.header-actions button:hover,
.header-actions a:hover {
    background: var(--hotlist-surface-light);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    z-index: 200;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    padding: 0 1rem;
}

.search-container input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.25rem;
    border: 2px solid var(--hotlist-border);
    border-radius: 16px;
    background: white;
    color: var(--hotlist-text);
    transition: border-color 0.2s;
}

.search-container input:focus {
    outline: none;
    border-color: var(--hotlist-primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.search-container button {
    padding: 1rem 2rem;
    background: var(--hotlist-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-container button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: var(--hotlist-text);
}

.page-header p {
    color: var(--hotlist-text-muted);
    margin: 0;
}

/* Home Page */
.hotlist-home .home-header {
    text-align: center;
    padding: 3rem 0;
}

.home-header h1 {
    font-size: 3rem;
    background: var(--hotlist-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.home-header p {
    color: var(--hotlist-text-muted);
    font-size: 1.25rem;
    margin-top: 0.5rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--hotlist-text);
}

.view-all {
    color: var(--hotlist-primary);
    text-decoration: none;
    font-weight: 500;
}

/* Digest Section */
.digest-section {
    margin-bottom: 3rem;
}

.digest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.digest-card {
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.digest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.digest-card.highlight {
    background: var(--hotlist-gradient);
    color: white;
    border: none;
}

.digest-badge {
    display: inline-block;
    background: rgba(33, 150, 243, 0.1);
    color: var(--hotlist-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.digest-card.highlight .digest-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.digest-label {
    display: block;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

.digest-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--hotlist-text);
}

.digest-card.highlight .digest-label,
.digest-card.highlight .digest-value {
    color: white;
}

/* Chart List */
.chart-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
}

.chart-item:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.rank-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px;
}

.rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hotlist-primary);
}

.movement {
    font-size: 0.75rem;
}

.movement.up {
    color: var(--hotlist-success);
}

.movement.down {
    color: var(--hotlist-danger);
}

.movement.new {
    color: var(--hotlist-primary);
}

.item-image {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2196F3, #64B5F6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--hotlist-text);
}

.item-info p {
    margin: 0;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

.item-meta {
    text-align: right;
}

.content-type {
    display: block;
    font-size: 0.75rem;
    color: var(--hotlist-primary);
    font-weight: 500;
}

.weeks {
    font-size: 0.75rem;
    color: var(--hotlist-text-muted);
}

/* Trending Grid */
.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.trending-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    border-radius: 16px;
    border-left: 4px solid var(--hotlist-border);
    box-shadow: var(--hotlist-shadow);
    transition: transform 0.2s;
}

.trending-card:hover {
    transform: translateY(-1px);
}

.trending-card.rising {
    border-left-color: var(--hotlist-success);
}

.trend-icon {
    font-size: 1.5rem;
}

.trend-content h4 {
    margin: 0;
    color: var(--hotlist-text);
}

.trend-content p {
    margin: 0;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

.source-app {
    display: inline-block;
    background: rgba(33, 150, 243, 0.1);
    color: var(--hotlist-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.chart-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    border-radius: 16px;
    text-decoration: none;
    color: var(--hotlist-text);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.chart-icon {
    font-size: 2rem;
}

.chart-info h4 {
    margin: 0;
    color: var(--hotlist-text);
}

.chart-info p {
    margin: 0;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

/* Creators List */
.creators-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.creator-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    border-radius: 16px;
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
    transition: transform 0.2s;
}

.creator-item:hover {
    transform: translateY(-1px);
}

.creator-rank {
    width: 30px;
    text-align: center;
    font-weight: 700;
    color: var(--hotlist-primary);
}

.creator-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2196F3, #64B5F6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.creator-info {
    flex: 1;
}

.creator-info h4 {
    margin: 0;
    color: var(--hotlist-text);
}

.creator-info p {
    margin: 0;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

.creator-stats {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hotlist-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--hotlist-text-muted);
}

/* Podium */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem;
}

.podium-place {
    text-align: center;
    padding: 1rem;
    border-radius: 16px;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
}

.podium-place.first {
    order: 2;
    padding-bottom: 2rem;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(100, 181, 246, 0.1));
}

.podium-place.second {
    order: 1;
}

.podium-place.third {
    order: 3;
}

.crown {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.podium-place .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    overflow: hidden;
    border: 3px solid var(--hotlist-border);
}

.podium-place .avatar.gold {
    border-color: #F59E0B;
}

.podium-place .avatar.silver {
    border-color: #C0C0C0;
}

.podium-place .avatar.bronze {
    border-color: #CD7F32;
}

.position {
    display: inline-block;
    background: rgba(33, 150, 243, 0.1);
    color: var(--hotlist-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    line-height: 24px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Leaderboard Table */
.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--hotlist-surface);
    backdrop-filter: var(--hotlist-blur);
    border-radius: 16px;
    box-shadow: var(--hotlist-shadow);
    border: 1px solid var(--hotlist-border);
    transition: transform 0.2s;
}

.leaderboard-row:hover {
    transform: translateY(-1px);
}

.leaderboard-row .rank {
    width: 40px;
    text-align: center;
    font-weight: 700;
    color: var(--hotlist-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.details h4 {
    margin: 0;
    color: var(--hotlist-text);
}

.details p {
    margin: 0;
    color: var(--hotlist-text-muted);
    font-size: 0.875rem;
}

.stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    text-align: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.diamond {
    background: linear-gradient(135deg, #B9F2FF, #89CFF0);
    color: #2c3e50;
}

.badge.gold {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: #2c3e50;
}

.badge.silver {
    background: #C0C0C0;
    color: #2c3e50;
}

/* Bottom Nav */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--hotlist-glass);
    backdrop-filter: var(--hotlist-blur);
    -webkit-backdrop-filter: var(--hotlist-blur);
    border-top: 1px solid var(--hotlist-border);
    padding: 0.5rem;
    z-index: 100;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--hotlist-text-muted);
    padding: 0.5rem;
    transition: color 0.2s;
}

.bottom-nav a.active {
    color: var(--hotlist-primary);
}

.bottom-nav .icon {
    font-size: 1.25rem;
}

.bottom-nav .label {
    font-size: 0.625rem;
}

/* Footer */
.app-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--hotlist-border);
    color: var(--hotlist-text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--hotlist-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--hotlist-primary);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(33, 150, 243, 0.2);
    border-top-color: var(--hotlist-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Not Found */
.not-found-page {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--hotlist-text);
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        padding: 1rem;
        padding-bottom: 5rem;
    }

    .app-footer {
        display: none;
    }

    .podium {
        flex-wrap: wrap;
    }

    .podium-place {
        flex: 1;
        min-width: 100px;
    }

    .app-header {
        padding: 0.75rem 1rem;
    }
}
