/* Video Page Specific Styles - FIXED COMPLETE VERSION */
/* public/assets/css/video-page.css */

/* Video Header - Changed to Red Theme */
.video-header {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.video-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
    line-height: 1.2;
}

.analysis-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.video-thumbnail {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 32px 0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.video-thumbnail:hover {
    transform: scale(1.02);
}

.stats-container {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.stat-card {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* Chart Section */
.chart-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 4px;
    font-weight: normal;
}

.chart-controls select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* FIXED: Chart Container Styles */
.chart-container {
    position: relative;
    height: 300px; /* Default height for timeline chart */
    margin-top: 24px;
    width: 100%;
    overflow: visible; /* Changed from hidden to prevent clipping */
}

/* FIXED: Specific styles for word frequency chart */
.chart-section:has(#word-frequency-chart) .chart-container {
    height: auto !important; /* Allow dynamic height */
    min-height: 300px; /* Minimum height */
    max-height: 700px; /* Maximum height to prevent too tall charts */
    overflow: visible; /* Prevent text clipping */
}

/* FIXED: Ensure charts take full container size */
#word-frequency-chart,
#comments-chart {
    max-width: 100% !important;
    height: 100% !important;
}

/* FIXED: Prevent canvas from being cut off */
.chart-section canvas {
    display: block;
    box-sizing: border-box;
}

/* Tools Section */
.tools-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    border: 1px solid #e9ecef;
}

.tools-header {
    text-align: center;
    margin-bottom: 24px;
}

.tools-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tools-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.tool-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
    color: #374151;
}

.tool-btn.primary {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
}

.tool-btn.primary:hover {
    background: #cc0000;
    border-color: #cc0000;
    color: white;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #6b7280;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-btn.twitter:hover { background: #1da1f2; color: white; border-color: #1da1f2; }
.share-btn.reddit:hover { background: #ff4500; color: white; border-color: #ff4500; }
.share-btn.facebook:hover { background: #1877f2; color: white; border-color: #1877f2; }
.share-btn.linkedin:hover { background: #0077b5; color: white; border-color: #0077b5; }

/* Ad Placeholder */
.ad-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    margin: 32px 0;
    color: #6b7280;
}

.ad-placeholder h3 {
    color: #374151;
    margin-bottom: 8px;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.search-header {
    text-align: center;
    margin-bottom: 32px;
}

.search-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.search-btn {
    padding: 12px 24px;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-btn:hover {
    background: #cc0000;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.search-results-info {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Comments List */
.comments-list {
    margin-top: 24px;
}

.comment-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.comment-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ff0000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-author {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.comment-author:hover {
    color: #ff0000;
}

.comment-type-badge {
    background: #ff0000;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.comment-date {
    color: #6b7280;
    font-size: 13px;
    margin-left: auto;
}

.comment-text {
    color: #1a1a1a;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
}

.comment-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-link {
    margin-left: auto;
}

.comment-link a {
    color: #ff0000;
    text-decoration: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-link a:hover {
    text-decoration: underline;
}

.load-more-section {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    padding: 12px 32px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

/* Breadcrumb */
.breadcrumb {
    background: #f8f9fa;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1a1a1a;
}

/* Back to Top */
.back-to-top {
    text-align: center;
    margin: 48px 0;
}

/* FIXED: Responsive Design for Word Frequency Chart */
@media (max-width: 768px) {
    .video-header h1 {
        font-size: 1.875rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tools-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-date {
        margin-left: 0;
    }
    
    .comment-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .comment-link {
        margin-left: 0;
    }
    
    /* FIXED: Mobile adjustments for word frequency chart */
    .chart-section:has(#word-frequency-chart) .chart-container {
        min-height: 250px;
        max-height: 500px;
    }
    
    /* Reduce padding on mobile for charts */
    .chart-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .video-header {
        padding: 24px 0;
    }
    
    .video-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-container,
    .chart-section,
    .tools-section,
    .search-section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .comment-item {
        padding: 16px;
    }
    
    /* FIXED: Smaller mobile adjustments for word frequency chart */
    .chart-section:has(#word-frequency-chart) .chart-container {
        min-height: 200px;
        max-height: 400px;
    }
    
    .chart-section {
        padding: 16px;
    }
    
    .chart-header {
        gap: 8px;
    }
    
    .chart-title {
        font-size: 1.25rem;
    }
}

/* FIXED: Print styles - hide charts from print */
@media print {
    .chart-section {
        display: none;
    }
    
    .tools-section {
        display: none;
    }
    
    .share-buttons {
        display: none;
    }
}