/* ===== NEWS PAGE STYLES - MODERN UI/UX ===== */

/* Modern Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Modern News Container */
.news-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    animation: fadeInUp 0.8s ease-out;
}

/* Modern Section Spacing */
.news-section {
    margin-bottom: 3rem;
}

.news-section:last-child {
    margin-bottom: 0;
}

/* Modern News Cards */
.news-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    cursor: pointer;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Staggered Animation Delays */
.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 Hover Effects */
.news-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.news-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* Modern Gradient Top Border */
.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #f5576c 75%, 
        #4facfe 100%);
    border-radius: 20px 20px 0 0;
}

/* Enhanced Featured News Card */
.featured-news-card {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.15) 0%, 
        rgba(118, 75, 162, 0.1) 50%,
        rgba(139, 92, 246, 0.15) 100%);
    border: 2px solid rgba(102, 126, 234, 0.4);
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
}

.featured-news-card:hover {
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Enhanced Trending News Card */
.trending-news-card {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.15) 0%, 
        rgba(245, 158, 11, 0.1) 50%,
        rgba(251, 191, 36, 0.15) 100%);
    border: 2px solid rgba(239, 68, 68, 0.4);
    box-shadow: 
        0 8px 32px rgba(239, 68, 68, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.trending-news-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

.trending-news-card:hover {
    box-shadow: 
        0 20px 40px rgba(239, 68, 68, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Modern News Categories */
.news-category {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

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

/* Enhanced Trending Badge */
.trending-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 50%, #ef4444 100%);
    background-size: 200% 200%;
    color: white;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 
        0 4px 8px rgba(239, 68, 68, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.trending-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

.category-crypto { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.category-stocks { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.category-economy { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.category-technology { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.category-general { background: rgba(107, 114, 128, 0.2); color: #6b7280; }

/* Sentiment Indicators */
.sentiment-positive { color: #10b981; }
.sentiment-negative { color: #ef4444; }
.sentiment-neutral { color: #6b7280; }

/* News Tags */
.news-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.7rem;
    margin: 2px;
    color: var(--text-muted);
}

/* Filter Buttons */
.filter-button {
    transition: all 0.2s ease;
    text-decoration: none;
    font-weight: 500;
}

.filter-button:hover {
    background: var(--bg-surface);
    transform: translateY(-1px);
}

.filter-button.active {
    background: var(--bg-surface);
    color: var(--text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Trending Badge */
.trending-badge {
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* News Card Content */
.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.news-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-card-summary {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.news-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-nav {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn:hover {
    background: var(--bg-surface);
}

.pagination-btn.active {
    background: var(--bg-surface);
    color: var(--text);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state-message {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Modern Filter Section */
.filter-section {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    animation: slideInLeft 0.6s ease-out;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 2rem;
}

.filter-button {
    padding: 10px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.filter-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.filter-button:hover::before {
    left: 100%;
}

.filter-button:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    color: var(--text);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.filter-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 
        0 8px 16px rgba(102, 126, 234, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Modern Filter Form Elements */
.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr;
    gap: 24px;
    align-items: end;
    margin-top: 2rem;
    width: 100%;
}

.filter-row {
    display: contents;
}

@media (max-width: 1024px) {
    .filter-form {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .filter-form .filter-field:nth-child(3) {
        grid-column: 1 / -1;
    }
    
    .filter-form .filter-field:nth-child(4) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .filter-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .filter-form .filter-field:nth-child(3),
    .filter-form .filter-field:nth-child(4) {
        grid-column: auto;
    }
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0; /* Prevents grid items from overflowing */
}

.filter-field label {
    display: block;
    width: 100%;
}

.filter-field select,
.filter-field input,
.filter-field button {
    display: block;
    width: 100%;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select,
.filter-input {
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.filter-input {
    font-size: 1rem;
    padding: 18px 22px;
}

.filter-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Fix for Firefox */
.filter-select::-moz-appearance {
    text-indent: 0.01px;
    text-overflow: '';
}

/* Fix for IE */
.filter-select::-ms-expand {
    display: none;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.filter-submit {
    padding: 18px 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-height: 56px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-submit i,
.filter-submit svg {
    flex-shrink: 0;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Ensure proper form display */
.filter-form * {
    box-sizing: border-box;
}

/* Fix for any potential display issues */
.filter-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr 2fr 1fr !important;
}

/* Ensure labels display properly */
.filter-label {
    display: block !important;
    margin-bottom: 8px !important;
}

/* Ensure form elements take full width */
.filter-field > * {
    width: 100% !important;
    max-width: 100% !important;
}

.filter-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
    z-index: 1;
}

.filter-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    z-index: 0;
}

.filter-submit:hover::before {
    left: 100%;
}

.filter-submit:hover::after {
    width: 300px;
    height: 300px;
}

.filter-submit:hover {
    transform: translateY(-4px) scale(1.02);
    background-position: 100% 100%;
    box-shadow: 
        0 16px 32px rgba(102, 126, 234, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-submit:hover svg {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.filter-submit:active {
    transform: translateY(-2px) scale(1.01);
    transition: all 0.1s ease;
    box-shadow: 
        0 8px 16px rgba(102, 126, 234, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-submit:focus {
    outline: none;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15),
        0 0 0 4px rgba(102, 126, 234, 0.3);
}

/* Loading state */
.filter-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.filter-submit.loading svg {
    animation: spin 1s linear infinite;
}

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

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Disabled state */
.filter-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 
        0 4px 8px rgba(102, 126, 234, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.filter-submit:disabled:hover {
    transform: none !important;
    box-shadow: 
        0 4px 8px rgba(102, 126, 234, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Modern Section Titles */
.section-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, 
        #667eea 0%, 
        #764ba2 30%,
        #f093fb 60%,
        transparent 100%);
    border-radius: 1px;
    margin-left: 16px;
}

.trending-title {
    animation: slideInRight 0.6s ease-out;
}

.trending-title .lucide {
    animation: bounce 2s infinite;
}

.news-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 8px;
}

/* Modern Card Content */
.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 12px;
}

.news-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.external-link-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.news-card:hover .external-link-icon {
    color: var(--text);
    transform: translateX(2px);
}

/* Modern Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.pagination-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: var(--text);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.filter-field {
    display: flex;
    flex-direction: column;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.filter-select, .filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-submit {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* News Badges */
.news-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Smart Categorization Badges */
.news-subcategory {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.featured-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a1a;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.4);
    animation: pulse 2s infinite;
}

.trending-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

/* Source Badge */
.news-source-badge {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.3);
}

/* General Category Styling */
.category-general {
    opacity: 0.6;
    background: #4b5563 !important;
    color: white !important;
}

.sentiment-icon {
    width: 14px;
    height: 14px;
}

.external-link-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* News Tags */
.news-tags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Section Title */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* News Meta */
.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Animation Delays */
.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; }

/* ===== AI CARD STYLES ===== */
.ai-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 18px;
    margin-top: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.ai-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ai-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ai-icon {
    font-size: 1.3rem;
    margin-right: 8px;
}

.ai-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    flex: 1;
}

.ai-sentiment-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ai-sentiment-badge.bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.ai-sentiment-badge.bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.ai-sentiment-badge.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.ai-card-body {
    margin-top: 8px;
}

.ai-summary {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.ai-view-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.ai-view-btn:hover {
    background: #2563eb;
}

/* ===== AI MODAL STYLES ===== */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ai-modal.hidden {
    display: none;
}

.ai-modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 14px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    color: var(--text-primary);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.ai-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.ai-modal-section {
    margin-bottom: 14px;
}

.ai-modal-section h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-version {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- AI Confidence Section --- */
.ai-confidence-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.ai-confidence-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 6px;
    margin-bottom: 4px;
}

.ai-confidence-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    transition: width 0.6s ease;
    border-radius: 5px;
}

.ai-confidence-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}


/* ===== DAILY DIGEST STYLES ===== */
.daily-digest-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.digest-summary {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.5;
}

.digest-details p {
    margin: 4px 0;
}

.digest-sentiment.bullish { 
    color: #10b981; 
}

.digest-sentiment.bearish { 
    color: #ef4444; 
}

.digest-sentiment.neutral { 
    color: #fbbf24; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .news-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .news-badges {
        width: 100%;
    }
    
    .daily-digest-box {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .daily-digest-box .section-title {
        font-size: 1.3rem;
    }
    
    .digest-summary {
        font-size: 1rem;
    }
}

/* === AI Insight Inline Display === */
.ai-insight-inline {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  transition: all 0.2s ease;
}
.ai-insight-inline:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.ai-insight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ai-icon {
  font-size: 1.1rem;
}
.ai-insight-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
}
.ai-sentiment-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ai-sentiment-badge.bullish {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.ai-sentiment-badge.bearish {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.ai-sentiment-badge.neutral {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}
.ai-insight-content {
  font-size: 0.85rem;
}
.ai-insight-section {
  margin-bottom: 8px;
}
.ai-insight-section strong {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
}
.ai-insight-section p {
  margin: 2px 0 0 0;
  color: var(--text-secondary);
  line-height: 1.4;
  font-size: 0.8rem;
}
.ai-insight-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  font-size: 0.75rem;
}
.ai-confidence-inline {
  color: var(--text-secondary);
}
.confidence-high {
  color: #10b981;
  font-weight: 600;
}
.confidence-moderate {
  color: #f59e0b;
  font-weight: 600;
}
.confidence-low {
  color: #ef4444;
  font-weight: 600;
}
.ai-model-inline {
  color: var(--text-secondary);
  font-weight: 500;
}

/* === AI Tooltip === */
.ai-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.ai-tooltip.hidden { display: none; }
.ai-tooltip-content {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  color: var(--text-primary);
  position: relative;
  animation: tooltipSlideIn 0.2s ease-out;
  border: 1px solid var(--border-color);
}
.ai-tooltip-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}
.ai-tooltip-close:hover {
  background: rgba(0,0,0,0.1);
}
.ai-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-right: 30px;
}
.ai-tooltip-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--text-primary);
}
.ai-tooltip-body {
  font-size: 0.85rem;
}
.ai-tooltip-section {
  margin-bottom: 10px;
}
.ai-tooltip-section strong {
  color: var(--text-primary);
  font-weight: 600;
}
.ai-tooltip-section p {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  line-height: 1.4;
}
.ai-tooltip-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
}
.ai-confidence-mini {
  color: var(--text-secondary);
}
.ai-version-mini {
  color: var(--text-secondary);
  font-weight: 500;
}
@keyframes tooltipSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-8px) scale(0.95); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* === Confidence Bar === */
.ai-confidence-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}
.ai-confidence-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 6px;
  margin-bottom: 4px;
}
.ai-confidence-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width 0.6s ease;
  border-radius: 5px;
}
.ai-confidence-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}
