/* Modern Insytio Design System */
:root {
    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-dark: #4c63d2;
    --primary-light: #e8efff;
    
    /* Secondary Colors */
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --secondary-dark: #e91e63;
    
    /* Neutral Colors */
    --background-primary: #fafbfc;
    --background-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* Accent Colors */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background-primary);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    min-height: 70px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-brand:hover {
    transform: translateY(-2px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-links a.active::after {
    width: 100%;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* News Sections */
.news-section {
    margin-bottom: 4rem;
}

.news-section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.news-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

/* Force 3 columns on larger screens with proper spacing */
@media (min-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        max-width: 1200px;
        margin: 2rem auto 0;
    }
}

/* 2 columns on medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Single column on small screens */
@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Modern News Cards */
.news-card {
    background: var(--background-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid rgba(102, 126, 234, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

.news-card:hover::before {
    transform: scaleX(1);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
    flex-shrink: 0;
    display: block;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.news-card:hover img {
    transform: scale(1.02);
}

.news-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

.news-card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-source {
    font-weight: 600;
    color: var(--primary-dark);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Search Styles */
.search-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem 0;
}

.search-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.search-section p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-form input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-form button {
    padding: 1rem 2rem;
    white-space: nowrap;
}

.search-results {
    text-align: left;
}

.search-results h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }
    
    .search-form button {
        padding: 1rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .nav-links {
        gap: 1.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.125rem;
    }
    
    .container {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .news-section h2 {
        font-size: 2rem;
    }
    
    .news-card img {
        height: 180px;
    }
    
    .news-card-content {
        padding: 1.25rem;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.75rem;
    }
    
    .hero {
        padding: 3rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .news-card-content {
        padding: 1.5rem;
    }
}

/* Loading and Animation States */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.news-card {
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:nth-child(1) { animation-delay: 0.1s; }
.news-card:nth-child(2) { animation-delay: 0.2s; }
.news-card:nth-child(3) { animation-delay: 0.3s; }
.news-card:nth-child(4) { animation-delay: 0.4s; }
.news-card:nth-child(5) { animation-delay: 0.5s; }
.news-card:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced Visual Effects */
.nav-brand {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradient 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Focus States for Accessibility */
.nav-links a:focus,
.news-card:focus,
.btn:focus {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Glass Effect for Navigation - integrated above */

/* News Meta matches homepage style */

/* Enhanced News Cards with Analytics */
.card-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quality-badge, .featured-badge, .ai-badge, .content-type-mini {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quality-excellent, .quality-high { background: #10b981; color: white; }
.quality-good, .quality-medium { background: #3b82f6; color: white; }
.quality-average { background: #f59e0b; color: white; }
.quality-poor, .quality-low { background: #ef4444; color: white; }
.quality-unknown { background: #6b7280; color: white; }

.content-type-mini {
    background: var(--secondary-gradient);
    color: white;
    font-size: 0.7rem;
}

.featured-badge { 
    background: #fbbf24; 
    color: #92400e; 
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.ai-badge { 
    background: #8b5cf6; 
    color: white; 
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.article-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.quality-score {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.article-stats-mini {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.article-stats-mini span {
    background: var(--background-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Professional Stats Layout */
.professional-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    background: var(--background-primary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Sentiment color coding */
.sentiment-positive {
    color: var(--success) !important;
}

.sentiment-negative {
    color: var(--error) !important;
}

.sentiment-neutral {
    color: var(--text-secondary) !important;
}

/* Mobile responsive stats */
@media (max-width: 480px) {
    .professional-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 0.75rem;
    }
    
    .stat-label {
        margin-bottom: 0;
    }
}

/* Content Type Cards */
.content-type-card {
    background: var(--background-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.content-type-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.content-type-header {
    padding: 1.5rem 1.5rem 1rem;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-type-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.article-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
}

.top-article {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.top-article img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.article-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-info p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.read-more {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--primary-gradient);
}

/* Professional News Controls */
.news-controls {
    background: var(--background-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.filter-section, .sort-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-section h4, .sort-section h4, .content-type-filters h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.filter-buttons, .sort-buttons, .type-filter-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.content-type-filters {
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-btn, .sort-btn, .type-filter-btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.type-filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.type-filter-btn .count {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.filter-btn:hover, .sort-btn:hover, .type-filter-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active, .sort-btn.active, .type-filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.type-filter-btn.active .count {
    color: rgba(255, 255, 255, 0.8);
}

/* Content type mini and article stats mini removed to match homepage style */

.load-more-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    margin-top: 1rem;
}

.load-more-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .news-controls {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .controls-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .filter-buttons, .sort-buttons, .type-filter-buttons {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .filter-btn, .sort-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    .type-filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
    
    .filter-section h4, .sort-section h4, .content-type-filters h4 {
        font-size: 0.9rem;
        text-align: center;
    }
}