/* ========================================
   NEWS HOME IMPROVED STYLES
   Enhanced design with modern UI/UX
   ======================================== */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #818cf8;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --white: #ffffff;
    --light-gray: #f8f9fa;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   PAGE LAYOUT
   ======================================== */

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 24px;
}

.mobile-filter-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 20px 30px -5px rgba(102, 126, 234, 0.5);
}

.mobile-filter-toggle i {
    transition: var(--transition-base);
}

.mobile-filter-toggle.active i {
    transform: rotate(180deg);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: var(--transition-base);
}

.sidebar-overlay.active {
    opacity: 1;
}

.news-page {
    min-height: calc(100vh - 200px);
    background: var(--gray-50);
}

/* ========================================
   PARALLAX HERO
   ======================================== */

.news-hero {
    position: relative;
    height: 420px;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 35%, 
        #f093fb 70%,
        #4facfe 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compact hero for category/tag/archive */
.news-hero.small {
    height: 260px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.2) 0%, transparent 50%),
        linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    animation: pulse-overlay 8s ease-in-out infinite;
}

/* Geometric Pattern Overlay */
.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.05) 35px, rgba(255,255,255,.05) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,.03) 35px, rgba(255,255,255,.03) 70px);
    opacity: 0.3;
}

@keyframes pulse-overlay {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    padding: 2rem;
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 0.6s ease-out;
}

.hero-badge i {
    font-size: 1.1rem;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero-title {
    font-size: 3.75rem;
    font-weight: 900;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 30px rgba(0,0,0,0.3),
                 0 2px 10px rgba(0,0,0,0.2);
    animation: fadeInDown 0.8s ease-out 0.1s backwards;
    line-height: 1.2;
}

.hero-icon {
    display: inline-block;
    font-size: 4.5rem;
    margin-right: 1rem;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(-3deg); 
    }
    50% { 
        transform: translateY(-15px) rotate(3deg); 
    }
}

.hero-title .highlight {
    background: linear-gradient(135deg, 
        #fbbf24 0%, 
        #f59e0b 50%,
        #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    position: relative;
    display: inline-block;
}

.hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #fbbf24 50%, 
        transparent 100%);
    border-radius: 2px;
}

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-shadow: 0 2px 15px rgba(0,0,0,0.2);
}

.hero-subtitle i {
    font-size: 1.2rem;
    opacity: 0.9;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.5s backwards;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: var(--transition-base);
    min-width: 18px;
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.stat-divider {
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

.main-container {
    padding: 3rem 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: 0.95rem;
    margin: 0.5rem 0 1.25rem 0;
}
.breadcrumbs a {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition-base);
}
.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}
.breadcrumbs span {
    color: var(--gray-400);
}

/* ========================================
   SIDEBAR
   ======================================== */

.news-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
    transition: var(--transition-base);
}

/* Mobile Sidebar Styles */
@media (max-width: 1024px) {
    .news-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        max-height: 100vh;
        background: white;
        z-index: 1000;
        padding: 2rem 1.5rem;
        overflow-y: auto;
        box-shadow: var(--shadow-xl);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .news-sidebar.active {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: var(--gray-100);
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 20px;
        color: var(--gray-600);
        cursor: pointer;
        transition: var(--transition-base);
    }
    
    .sidebar-close:hover {
        background: var(--gray-200);
        color: var(--gray-800);
        transform: rotate(90deg);
    }
}

.news-sidebar::-webkit-scrollbar {
    width: 6px;
}

.news-sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.news-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.news-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.sidebar-widget {
    background: #fdfdff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid var(--gray-100);
    transition: var(--transition-base);
}

.sidebar-widget:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.widget-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ========================================
   ARCHIVE & CATEGORIES WIDGETS
   ======================================== */
.archive-list,
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.archive-item,
.category-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    background: #fafbff;
    border: 1px solid var(--gray-100);
    transition: var(--transition-base);
}
.archive-item i,
.category-item i {
    color: var(--gray-400);
}
.archive-item:hover,
.category-item:hover {
    background: var(--gray-100);
    transform: none;
}
.archive-item.active,
.category-item.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
    border-color: var(--primary);
    color: var(--primary);
}
.archive-item.active i,
.category-item.active i {
    color: var(--primary);
}

/* ========================================
   VIEW MODE SELECTOR
   ======================================== */

.view-mode-buttons {
    display: flex;
    gap: 0.75rem;
}

.view-mode-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 1.25rem;
}

.view-mode-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.view-mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* RSS widget */
.rss-widget .rss-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(253, 149, 31, 0.08);
    color: #c2410c;
    border: 1px solid rgba(253, 149, 31, 0.25);
    font-weight: 600;
    transition: var(--transition-base);
}
.rss-widget .rss-subscribe i { color: #f97316; }
.rss-widget .rss-subscribe:hover {
    background: rgba(253, 149, 31, 0.12);
}
.rss-widget .rss-note {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* Category badge on cards */
.category-badge {
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255,255,255,0.9);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    backdrop-filter: blur(6px);
}
.category-badge i { color: var(--primary); }
.category-badge:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ========================================
   SEARCH WIDGET
   ======================================== */

.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition-base);
    background: var(--gray-50);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.search-input:not(:placeholder-shown) + .search-clear {
    display: flex;
}

.search-clear:hover {
    background: var(--danger);
    color: white;
}

.search-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* ========================================
   FILTER OPTIONS
   ======================================== */

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option {
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.filter-option i {
    font-size: 1.1rem;
    color: var(--gray-400);
    transition: var(--transition-base);
}

.filter-option:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-900);
    transform: translateX(4px);
}

.filter-option:hover i {
    color: var(--primary);
}

.filter-option.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.filter-option.active i {
    color: var(--primary);
}

/* ========================================
   POPULAR & LATEST WIDGETS
   ======================================== */

.popular-list,
.latest-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition-base);
}

.popular-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.popular-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.popular-content {
    flex: 1;
    min-width: 0;
}

.popular-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popular-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-meta i {
    font-size: 0.8rem;
}

.latest-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition-base);
}

.latest-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.latest-thumb,
.latest-thumb-placeholder {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.latest-thumb-placeholder {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.latest-content {
    flex: 1;
    min-width: 0;
}

.latest-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.4;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.latest-date {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.latest-date i {
    font-size: 0.8rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.news-content {
    flex: 1;
    min-width: 0;
}

/* ========================================
   ACTIVE FILTERS DISPLAY
   ======================================== */

.active-filters {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filters-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-right: 0.5rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border: 1px solid rgba(102,126,234,0.3);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-badge i {
    font-size: 0.85rem;
}

.filter-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    margin-left: 0.25rem;
    transition: var(--transition-base);
}

.filter-remove:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.clear-all-filters {
    margin-left: auto;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-all-filters:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ========================================
   RESULTS HEADER
   ======================================== */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.results-count {
    font-size: 1.1rem;
    color: var(--gray-700);
}

.results-count strong {
    color: var(--primary);
    font-weight: 700;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.per-page-selector label {
    font-size: 0.95rem;
    color: var(--gray-600);
    font-weight: 500;
}

.per-page-select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-700);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.per-page-select:hover {
    border-color: var(--primary);
}

.per-page-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   NEWS GRID / LIST
   ======================================== */

.news-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-grid.view-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.news-grid.view-list {
    grid-template-columns: 1fr;
}

.news-grid.view-compact {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* ========================================
   NEWS CARD
   ======================================== */

.news-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.news-card:hover::before {
    transform: scaleX(1);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--gray-200);
}

/* Grid View */
.view-grid .news-card .news-image {
    height: 220px;
}

/* List View */
.view-list .news-card {
    flex-direction: row;
}

.view-list .news-card .news-image {
    width: 350px;
    height: auto;
    flex-shrink: 0;
}

.view-list .news-card .news-content {
    flex: 1;
}

/* Compact View */
.view-compact .news-card .news-image {
    height: 180px;
}

.view-compact .news-card .news-title {
    font-size: 1.1rem;
}

.view-compact .news-card .news-excerpt {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* ========================================
    line-clamp: 2;
   NEWS IMAGE
   ======================================== */

.news-image {
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.news-card:hover .news-image img {
    transform: scale(1.1) rotate(2deg);
}

.news-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

/* ========================================
   NEWS BADGE
   ======================================== */

.news-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    }
}

.news-badge.hot {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.news-badge i {
    animation: flicker 1.5s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   NEWS CONTENT
   ======================================== */

.news-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.news-date,
.reading-time {
    font-size: 0.9rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-date i,
.reading-time i {
    color: var(--primary);
}

.news-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

.news-excerpt {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
    font-size: 0.95rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.news-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.news-footer .stat-item {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-base);
    white-space: nowrap;
    line-clamp: 2;
}

.news-footer .stat-item:hover {
    color: var(--primary);
}

.news-footer .stat-item i {
    color: var(--primary);
    font-size: 0.75rem;
}

.read-more {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.read-more:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.read-more i {
    transition: var(--transition-base);
}

.read-more:hover i {
    transform: translateX(4px);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination-wrapper {
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.pagination-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-first,
.pagination-last {
    padding: 0.75rem;
}

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

.pagination-page {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-base);
}

.pagination-page:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.pagination-page.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-info {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* ========================================
   INFINITE SCROLL
   ======================================== */

#infinite-scroll-sentinel {
    height: 1px;
    margin-top: 2rem;
}

.infinite-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--gray-600);
    font-weight: 500;
}

.loader-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   NO NEWS / ERROR
   ======================================== */

.no-news {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.no-news-icon {
    font-size: 5rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.no-news h3 {
    font-size: 1.75rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.no-news p {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition-base);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-message i {
    font-size: 1.75rem;
    color: var(--danger);
}

.error-message p {
    color: var(--danger);
    font-weight: 500;
    margin: 0;
}

/* ========================================
   SCROLL TO TOP BUTTON
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: var(--transition-base);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.scroll-to-top:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.scroll-to-top:active {
    transform: scale(0.95);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .news-sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .sidebar-widget {
        margin-bottom: 0;
    }

    .view-list .news-card {
        flex-direction: column;
    }

    .view-list .news-card .news-image {
        width: 100%;
        height: 220px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-icon {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-divider {
        width: 50px;
        height: 2px;
    }

    .news-grid.view-grid,
    .news-grid.view-compact {
        grid-template-columns: 1fr;
    }

    .news-sidebar {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .per-page-selector {
        width: 100%;
    }

    .per-page-select {
        flex: 1;
    }

    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .clear-all-filters {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-pages {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-icon {
        font-size: 2.5rem;
        margin-right: 0.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .news-card {
        border-radius: var(--radius-lg);
    }

    .news-content {
        padding: 1.25rem;
    }

    .news-title {
        font-size: 1.2rem;
    }

    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .news-sidebar,
    .pagination-wrapper,
    .scroll-to-top,
    .active-filters {
        display: none !important;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .news-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}


