/* ========================================
   Card Components - DRY Refactored
   ======================================== */

/* ========================================
   0. UNIFIED CARD SYSTEM
   Base styles for all card types
   ======================================== */

/* Base card (inherited by all cards) */
.card {
    background: var(--color-bg-elevated, #1a1a1a);
    border: 1px solid var(--color-border-primary, #333);
    border-radius: var(--radius-lg, 8px);
    padding: var(--space-4, 1rem);
    transition: all 0.2s ease;
}

/* Clickable cards */
.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* ----------------------------------------
   Card Variants
   ---------------------------------------- */

/* Default card (basic content boxes) */
.card-default {
    /* Inherits base styles */
}

/* Stat card (KPI cards with icon + number + label) */
.card-stat {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    padding: 25px;
}

.card-stat .card-icon {
    font-size: 3em;
    margin-right: 20px;
}

.card-stat .card-content {
    flex: 1;
}

.card-stat .card-value {
    font-size: 2.5em;
    font-weight: var(--font-bold, 700);
    color: var(--color-success-bright, #4CAF50);
    line-height: 1;
    margin-bottom: 5px;
}

.card-stat .card-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary, #aaa);
    font-weight: var(--font-medium, 500);
}

/* Video card (media + content) */
.card-video {
    padding: 0;
    overflow: hidden;
}

.card-video img {
    width: 100%;
    height: auto;
}

.card-video .card-content {
    padding: var(--space-4, 1rem);
}

/* Outline card (subtle border, no background) */
.card-outline {
    background: transparent;
    border: 2px dashed var(--color-border-secondary, #444);
}

/* ----------------------------------------
   Status Colors
   ---------------------------------------- */

.card-status-good {
    border-left: 4px solid var(--color-success-bright, #4CAF50);
}

.card-status-warning {
    border-left: 4px solid var(--color-warning, #ff9800);
}

.card-status-bad {
    border-left: 4px solid var(--color-danger, #f44336);
}

/* ----------------------------------------
   Card Layout Helpers
   ---------------------------------------- */

.card-horizontal {
    display: flex;
    flex-direction: row;
    gap: var(--space-4, 1rem);
}

.card-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
}

/* ========================================
   1. VIDEO GRID LAYOUT
   ======================================== */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   2. VIDEO CARD (BASE)
   ======================================== */

.video-card {
    background-color: var(--color-bg-input);
    border-radius: var(--radius-xl);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    position: relative;
}

.video-card:hover {
    border-color: var(--color-brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.video-card.analyzed {
    border: 2px solid var(--color-success-bright);
}

.video-card .video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-card .video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-xl);
}

.video-card .video-info {
    padding: 15px;
}

.video-card .video-meta {
    color: var(--color-text-muted);
    font-size: 13px;
    margin: 5px 0;
}

/* ========================================
   3. CARD SECTIONS
   ======================================== */

.card-header {
    margin-bottom: 15px;
}

/* General video title style (used across all cards) */
.video-title {
    margin: 0 0 8px 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    color: var(--color-brand-primary);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    line-height: var(--leading-tight);
}

.channel-link {
    color: var(--color-brand-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.channel-link:hover {
    text-decoration: underline;
    color: var(--color-brand-secondary);
}

.card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px 0;
    border-top: 1px solid var(--color-border-primary);
    border-bottom: 1px solid var(--color-border-primary);
}

@media (max-width: 768px) {
    .card-meta {
        grid-template-columns: 1fr;
    }
}

.meta-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
}

.meta-label {
    color: var(--color-text-subtle);
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
}

.meta-value {
    color: var(--color-text-muted);
    font-size: var(--text-body);
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
}

.card-sentiment {
    margin-bottom: 15px;
}

.sentiment-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sentiment-preview .sentiment-label {
    color: var(--color-text-subtle);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    line-height: var(--leading-tight);
}

.sentiment-indicator {
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
    color: var(--color-text-muted);
    font-size: var(--text-body);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
    color: var(--color-text-subtle);
}

.method-badge {
    display: inline-block;
    color: var(--color-text-muted);
    font-weight: var(--font-normal);
    line-height: var(--leading-tight);
    margin-left: 8px;
    font-size: var(--text-body);
}

.view-link {
    color: var(--color-brand-primary);
    font-weight: var(--font-medium);
}

/* ========================================
   4. ROW VIEW CARDS
   ======================================== */

.video-row-card {
    position: relative;
}

.row-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    min-width: 50px;
}

/* ========================================
   5. REFERENCE CARDS
   ======================================== */

.reference-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-xl);
    align-items: center;
}

.reference-card .video-thumbnail {
    width: 200px;
    height: auto;
    border-radius: var(--radius-xl);
}

.reference-card .video-info {
    flex: 1;
}

.reference-card h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--color-text-primary);
}

.reference-card p {
    color: var(--color-text-tertiary);
    font-size: 14px;
    margin: 5px 0;
}

/* Base analyzed/not-analyzed badge styles */
.analyzed-badge,
.not-analyzed-badge {
    display: inline-block;
    padding: 5px 10px;
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    font-size: 12px;
    margin: 10px 0;
}

.analyzed-badge {
    background: var(--color-success-bright);
}

.not-analyzed-badge {
    background: var(--color-accent-gray-light);
}

/* ========================================
   6. TIMELINE SECTIONS
   ======================================== */

.timeline-section {
    margin: 30px 0;
    padding: 20px;
    border-radius: var(--radius-xl);
}

.timeline-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: var(--color-text-primary);
}

.newer-section {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--color-accent-blue);
}

.reference-section {
    background: rgba(234, 179, 8, 0.1);
    border-left: 4px solid var(--color-accent-yellow);
}

.earlier-section {
    background: rgba(156, 163, 175, 0.1);
    border-left: 4px solid var(--color-accent-gray);
}

/* ========================================
   7. EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--color-bg-input);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--color-border-primary);
}

.empty-state p {
    color: var(--color-text-subtle);
    font-size: var(--text-heading);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
    margin: 10px 0;
}

.empty-state .empty-hint {
    color: var(--color-text-disabled);
    font-size: var(--text-body);
}

/* ========================================
   8. LOAD MORE
   ======================================== */

.load-more-container {
    text-align: center;
    margin: 30px 0;
}

.load-more-container button {
    padding: 12px 24px;
    font-size: 14px;
}

/* ========================================
   9. VIDEO DETAIL PAGE
   ======================================== */

.not-analyzed-notice {
    color: var(--color-text-subtle);
    font-size: var(--text-body);
    margin-top: 10px;
}

.info-item {
    margin-top: 20px;
}
