/**
 * Insights Page - Victory Engine Aesthetic
 * Clean content library with search and filter system
 */

/* Hero Section */
.insights-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1a2942 100%);
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.insights-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(200, 157, 92, 0.1), transparent 70%);
    pointer-events: none;
}

.insights-hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.insights-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.insights-hero .hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
}

/* Newsletter Bar */
.newsletter-bar {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.newsletter-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.newsletter-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--white);
}

.newsletter-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 0 0.25rem 0;
    color: var(--white);
}

.newsletter-desc {
    font-size: 0.9375rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    flex: 1;
    max-width: 500px;
}

.newsletter-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    transition: all var(--transition-base);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--white);
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.newsletter-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    display: none;
}

.newsletter-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 2px solid #10b981;
    display: block;
}

.newsletter-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 2px solid #ef4444;
    display: block;
}

/* Insights Section */
.insights-section {
    padding: 4rem 0;
}

/* Controls */
.insights-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(200, 157, 92, 0.1);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: var(--white);
    border-color: transparent;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.insight-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.insight-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.insight-category {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-category-research_report {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.insight-category-publication {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.insight-category-press_release {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
}

.insight-category-newsletter {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

.insight-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.insight-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.3;
    margin: 0;
}

.insight-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.insight-title a:hover {
    color: var(--gold-primary);
}

.insight-excerpt {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.insight-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
}

.insight-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.insight-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-decoration: none;
    transition: all var(--transition-base);
}

.insight-read-more:hover {
    gap: 0.75rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
    margin: 0;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.pagination-btn,
.pagination-page {
    padding: 0.75rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn:hover,
.pagination-page:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.pagination-page.active {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: var(--white);
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
}

/* Insight Detail Page */
.breadcrumb-container {
    background: var(--bg-secondary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--gold-primary);
}

.insight-detail {
    padding: 4rem 0;
}

.insight-detail-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.insight-detail-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 1.5rem 0;
}

.insight-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

/* Share and Download Actions */
.insight-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-detail-content {
    max-width: 800px;
    margin: 0 auto 4rem;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.insight-detail-content h2 {
    font-size: 2rem;
    font-weight: 900;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
}

.insight-detail-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.insight-detail-content p {
    margin-bottom: 1.5rem;
}

.insight-detail-content ul,
.insight-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.insight-detail-content li {
    margin-bottom: 0.75rem;
}

/* Insight CTA */
.insight-cta {
    background: linear-gradient(135deg, var(--navy), #1a2942);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 700px;
    margin: 4rem auto;
}

.insight-cta h3 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    margin: 0 0 0.5rem 0;
}

.insight-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 2rem 0;
}

/* Related Insights */
.related-insights {
    margin: 4rem 0;
    padding-top: 4rem;
    border-top: 2px solid var(--border);
}

.related-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-align: center;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 4rem;
}

/* Report Styling */
.report-meta {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    border-left: 4px solid var(--gold-primary);
}

.report-meta p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
}

.report-table thead {
    background: linear-gradient(135deg, var(--navy), #1a2942);
}

.report-table th {
    padding: 1rem;
    text-align: left;
    color: var(--white);
    font-weight: 700;
    border-bottom: 2px solid var(--gold-primary);
}

.report-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.report-table tbody tr:hover {
    background: var(--bg-secondary);
}

.author-bio {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin: 3rem 0 2rem;
}

.author-bio h3 {
    color: var(--gold-primary);
    margin: 0 0 1rem 0;
}

.disclaimer {
    background: rgba(200, 157, 92, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--gold-primary);
    margin-top: 2rem;
}

.disclaimer p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.insight-detail-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
}

.insight-detail-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.insight-detail-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 3rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .insights-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .report-table {
        font-size: 0.8125rem;
    }
    
    .report-table th,
    .report-table td {
        padding: 0.75rem;
    }
    
    .newsletter-content {
        flex-direction: column;
    }
    
    .newsletter-form {
        width: 100%;
        max-width: none;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        flex-direction: column;
    }
    
    .filter-tab {
        width: 100%;
        text-align: center;
    }
    
    .insight-detail-title {
        font-size: 2rem;
    }
    
    .insight-detail-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .pagination-pages {
        order: -1;
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles for PDF Generation */
@media print {
    /* Hide non-essential elements */
    header, 
    footer, 
    .breadcrumb-container,
    .insight-actions,
    .insight-cta,
    .related-insights,
    .back-link,
    .newsletter-bar {
        display: none !important;
    }
    
    /* Page setup */
    @page {
        margin: 2cm;
        size: A4;
    }
    
    body {
        background: white;
        color: #000;
    }
    
    /* Ensure content fits on page */
    .insight-detail {
        padding: 0;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .insight-detail-header {
        margin-bottom: 2rem;
        page-break-after: avoid;
    }
    
    .insight-category {
        background: #0F1629 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .insight-detail-title {
        font-size: 24pt;
        color: #000;
        margin: 1rem 0;
    }
    
    .insight-detail-meta {
        font-size: 10pt;
        color: #666;
        justify-content: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .insight-detail-content {
        font-size: 11pt;
        line-height: 1.6;
        color: #000;
        max-width: 100%;
    }
    
    .insight-detail-content h2 {
        font-size: 18pt;
        margin-top: 1.5rem;
        page-break-after: avoid;
        color: #000;
    }
    
    .insight-detail-content h3 {
        font-size: 14pt;
        page-break-after: avoid;
        color: #000;
    }
    
    .insight-detail-content h4 {
        font-size: 12pt;
        page-break-after: avoid;
        color: #000;
    }
    
    /* Avoid page breaks inside elements */
    .insight-detail-content p,
    .insight-detail-content ul,
    .insight-detail-content ol,
    .insight-detail-content table,
    .report-meta,
    .author-bio,
    .disclaimer {
        page-break-inside: avoid;
    }
    
    /* Table styling for print */
    .report-table {
        width: 100%;
        border-collapse: collapse;
        margin: 1rem 0;
        page-break-inside: avoid;
        font-size: 9pt;
    }
    
    .report-table th,
    .report-table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        text-align: left;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .report-table thead {
        background: #0F1629 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .report-table tbody tr:nth-child(even) {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Links */
    a {
        color: #000;
        text-decoration: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
    }
    
    /* Author bio and disclaimer */
    .author-bio,
    .disclaimer {
        border-top: 2px solid #000;
        padding-top: 1rem;
        margin-top: 2rem;
        font-size: 10pt;
    }
    
    .author-bio h3,
    .disclaimer strong {
        font-size: 12pt;
        margin-bottom: 0.5rem;
    }
}
