/* =============================================
   COMPONENTS.CSS — Additional component styles
   ============================================= */

/* --- Channel Modal (expanded view) --- */
.modal-channel-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-channel-info {
    flex: 1;
}

.modal-channel-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.modal-channel-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-channel-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* Episode list in modal */
.modal-episodes {
    margin-top: 16px;
}

.modal-episode {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius-sm);
    margin-bottom: 10px;
    background: rgba(6, 10, 16, 0.4);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.modal-episode:hover {
    border-color: var(--border-accent);
    background: rgba(77, 200, 200, 0.03);
}

.modal-ep-play {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--teal-deep);
    border: 1px solid var(--border-accent);
    color: var(--teal-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}
.modal-ep-play:hover {
    background: var(--teal-primary);
    color: var(--bg-void);
    box-shadow: 0 0 16px var(--teal-glow);
}

/* Playing state — pulsing teal button */
.modal-episode.is-playing .modal-ep-play {
    background: var(--teal-primary);
    color: var(--bg-void);
    box-shadow: 0 0 16px var(--teal-glow);
    animation: epPlayPulse 1.8s ease-in-out infinite;
}
@keyframes epPlayPulse {
    0%, 100% { box-shadow: 0 0 12px var(--teal-glow); }
    50% { box-shadow: 0 0 24px var(--teal-glow), 0 0 40px rgba(77, 200, 200, 0.15); }
}
.modal-episode.is-playing {
    border-color: var(--teal-primary);
    background: rgba(77, 200, 200, 0.05);
}

.modal-ep-info {
    flex: 1;
    min-width: 0;
}

.modal-ep-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--teal-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.modal-ep-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-ep-meta {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.modal-ep-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
}

.modal-ep-size {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* --- Sources Modal --- */
.sources-channel {
    margin-bottom: 24px;
}
.sources-channel-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.source-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.source-item:last-child {
    border-bottom: none;
}

.source-title {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}
.source-title a {
    color: var(--teal-primary);
}
.source-title a:hover {
    color: var(--teal-bright);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.source-domain {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: var(--z-toast);
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-radius: var(--card-radius-sm);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 13px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s var(--ease-out-expo);
    max-width: 360px;
}
.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-success { border-color: rgba(46, 204, 113, 0.4); }
.toast-error { border-color: rgba(231, 76, 60, 0.4); }

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 200px;
    border-radius: var(--card-radius);
}

/* --- Chatbot Modal --- */
.chatbot-modal {
    max-width: 500px;
}

.chatbot-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(6, 10, 16, 0.6);
    border-radius: var(--card-radius-sm);
    border: 1px solid var(--border-subtle);
}

.chat-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
}
.chat-msg-user {
    background: var(--teal-deep);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    margin-left: auto;
}
.chat-msg-bot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.chatbot-input-row {
    display: flex;
    gap: 8px;
}
.chatbot-input-row input {
    flex: 1;
}

/* --- Preview Badge / Status Indicators --- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-idle { background: var(--text-muted); }
.status-generating {
    background: #f1c40f;
    animation: statusPulse 1s ease-in-out infinite;
}
.status-done { background: #2ecc71; }
.status-error { background: var(--danger); }

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(241, 196, 15, 0); }
}

/* --- Episode Word Count / Duration estimate --- */
.ep-duration {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* --- GSAP reveal classes --- */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}
.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}
.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s var(--ease-out-expo);
}

/* --- Generate All confirmation --- */
.gen-all-confirm {
    text-align: center;
    padding: 20px 0;
}
.gen-all-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}
.gen-all-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--teal-deep);
    border: 1px solid var(--border-accent);
    color: var(--teal-primary);
}
.gen-all-chip.done {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

/* --- RSS Feed links --- */
.channel-rss-link {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.channel-rss-link:hover {
    border-color: var(--border-accent);
    color: var(--teal-primary);
}
