/* ===== Channel Page ===== */
.channel-page {
    margin: 0 auto;
}

.channel-banner {
    height: 200px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: cover;
    background-position: center;
    border-radius: 0 0 12px 12px;
    position: relative;
}

.banner-edit-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 5;
}

.banner-edit-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Channel Header */
.channel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    margin-top: -40px;
    position: relative;
}

.channel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--bg-primary, #0d0d0d);
    object-fit: cover;
}

.channel-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 32px;
    font-weight: 700;
}

.channel-info {
    flex: 1;
    padding-top: 20px;
}

.channel-name {
    margin: 0;
    font-size: 24px;
    color: var(--text-primary, #f0f0f0);
}

.channel-stats {
    color: var(--text-secondary, #888);
    font-size: 14px;
    margin-top: 4px;
}

.channel-page .live-badge {
    position: static;
    top: auto;
    left: auto;
    background: none;
    box-shadow: none;
    padding: 0;
    color: #ff4444;
    font-weight: 600;
    font-size: 13px;
    animation: pulse-live 2s infinite;
    pointer-events: auto;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 0;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.channel-actions {
    display: flex;
    gap: 8px;
    padding-top: 20px;
}

.btn-follow {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: var(--accent, #667eea);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-follow:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
}

.btn-follow.following {
    background: transparent;
    border: 1px solid var(--border, #333);
    color: var(--text-secondary, #888);
}

.btn-post-content {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: var(--accent-color, #ff1212);
    color: white;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-post-content:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    color: white;
}

.btn-watch-live {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: #ff4444;
    color: white;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-watch-live:hover {
    filter: brightness(1.15);
}

/* Live Avatar Indicator */
.avatar-live .channel-avatar {
    border: 3px solid var(--accent-color, #ff1212);
    box-shadow: 0 0 12px rgba(255, 18, 18, 0.4);
}

.channel-avatar-area {
    position: relative;
}

.avatar-live-label {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color, #ff1212);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Live Streams Section */
.channel-live-section {
    margin: 20px 24px 8px;
}

.live-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #f0f0f0);
    margin: 0 0 12px;
}

.live-streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.live-stream-card {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.15s;
}

.live-stream-card:hover {
    transform: scale(1.02);
}

.live-thumbnail-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.live-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.live-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4444;
    font-size: 24px;
    font-weight: 700;
}

.live-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-badge-lg {
    background: #ff4444;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.live-title {
    color: white;
    font-size: 16px;
}

/* Tabs */
.channel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.tab {
    padding: 6px 16px;
    color: var(--text-secondary, #888);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-secondary, #111);
    border: 1px solid var(--border, #222);
    border-radius: 20px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--text-primary, #f0f0f0);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border, #333);
}

.tab.active {
    color: white;
    background: var(--accent-color, #ff1212);
    border-color: var(--accent-color, #ff1212);
}

/* Content Grid */
.channel-content {
    padding: 16px 24px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.content-card {
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary, #111);
    border: 1px solid var(--border, #1a1a1a);
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.content-card.seen {
    opacity: 0.65;
}

.content-card.seen:hover {
    opacity: 1;
}

.card-thumb {
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder,
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-secondary, #555);
}

.audio-thumb {
    aspect-ratio: 1;
}

.post-thumb {
    padding: 14px;
    min-height: 120px;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

.post-preview-text {
    color: var(--text-secondary, #aaa);
    font-size: 13px;
    line-height: 1.5;
}

.post-preview-img {
    margin-top: 8px;
    border-radius: 6px;
    max-height: 80px;
}

.duration-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.content-type-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 0;
}

.content-type-badge svg {
    width: 21px;
    height: 21px;
    stroke: #fff;
}

.card-meta {
    padding: 10px;
}

.card-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #f0f0f0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-date,
.card-views {
    display: block;
    font-size: 12px;
    color: var(--text-secondary, #999);
    margin-top: 2px;
}

/* Schedule */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    background: var(--bg-secondary, #111);
    border: 1px solid var(--border, #1a1a1a);
}

.schedule-time {
    min-width: 180px;
}

.schedule-date {
    display: block;
    font-size: 14px;
    color: var(--text-primary, #f0f0f0);
}

.schedule-countdown {
    display: block;
    font-size: 12px;
    color: var(--accent, #667eea);
}

.schedule-title {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary, #f0f0f0);
}

.schedule-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #555);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
}

.schedule-delete-btn:hover {
    color: #ff4444;
}

.schedule-add-form {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-secondary, #111);
    border-radius: 12px;
    border: 1px solid var(--border, #1a1a1a);
}

.schedule-add-form h3 {
    margin: 0 0 12px;
}

.schedule-add-form input,
.schedule-add-form select {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--bg-primary, #0d0d0d);
    border: 1px solid var(--border, #222);
    border-radius: 8px;
    color: var(--text-primary, #f0f0f0);
    margin-bottom: 8px;
    font-size: 14px;
}

.empty-state {
    color: var(--text-secondary, #555);
    text-align: center;
    padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .channel-header {
        padding: 0 12px;
    }

    .channel-content {
        padding: 12px;
    }

    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .channel-banner {
        height: 140px;
    }
}

/* ===== Posts Timeline ===== */
.posts-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
}

.post-timeline-item {
    background: var(--secondary-bg, #111);
    border-radius: 8px;
    padding: 1.2rem;
    border-left: 3px solid var(--accent-color, #ff1212);
}

.post-timeline-header {
    margin-bottom: 0.6rem;
}

.post-timeline-date {
    font-size: 0.75rem;
    color: #888;
}

.post-timeline-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ddd;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 0.8rem;
}

/* Image grid inside post timeline */
.post-timeline-images {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.post-timeline-images.single img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.post-timeline-images.double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.post-timeline-images.double img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.post-timeline-images.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.post-timeline-images.grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.post-timeline-footer {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding-top: 0.6rem;
    border-top: 1px solid #222;
}

.post-timeline-footer .vote-buttons {
    display: flex;
    gap: 0.5rem;
}

.post-timeline-footer .vote-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px 10px;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.post-timeline-footer .vote-btn:hover {
    border-color: #555;
    color: #ccc;
}

.post-timeline-footer .vote-btn.active.upvote {
    color: #4caf50;
    border-color: #4caf50;
}

.post-timeline-footer .vote-btn.active.downvote {
    color: #f44336;
    border-color: #f44336;
}

.post-timeline-comments {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.15s;
}

.post-timeline-comments:hover {
    color: var(--accent-color, #ff1212);
}

.post-timeline-link {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--accent-color, #ff1212);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.post-timeline-link:hover {
    opacity: 1;
}

/* Break out of .container max-width for channel pages */
.container:has(.channel-page) {
    max-width: none;
}

/* Two-Column Layout */
.channel-two-col {
    display: flex;
    gap: 32px;
    padding: 0 24px;
}

.channel-two-col .channel-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 16px 0;
}

/* Sidebar */
.channel-sidebar {
    width: 340px;
    flex-shrink: 0;
    padding-top: 16px;
}

.sidebar-channels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (max-width: 900px) {
    .channel-two-col {
        flex-direction: column;
        padding: 0 12px;
    }

    .channel-two-col .channel-content {
        overflow: visible;
    }

    .channel-sidebar {
        width: 100%;
    }

    .sidebar-channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}