/* SpectruRO - Custom Styles */

/* Dark Mode Configuration */
.dark {
    color-scheme: dark;
}

/* Bias Badge Colors - Enhanced for Dark Mode */
.bias-badge-red { 
    background-color: #dc2626; 
    color: white; 
}
.dark .bias-badge-red {
    background-color: #ef4444;
    color: white;
}

.bias-badge-yellow { 
    background-color: #eab308; 
    color: white; 
}
.dark .bias-badge-yellow {
    background-color: #fbbf24;
    color: #1f2937;
}

.bias-badge-gold { 
    background-color: #f59e0b; 
    color: white; 
}
.dark .bias-badge-gold {
    background-color: #fb923c;
    color: white;
}

.bias-badge-gray { 
    background-color: #6b7280; 
    color: white; 
}
.dark .bias-badge-gray {
    background-color: #9ca3af;
    color: #1f2937;
}

.bias-badge-green { 
    background-color: #10b981; 
    color: white; 
}
.dark .bias-badge-green {
    background-color: #34d399;
    color: #1f2937;
}

.bias-badge-blue { 
    background-color: #3b82f6; 
    color: white; 
}
.dark .bias-badge-blue {
    background-color: #60a5fa;
    color: #1f2937;
}

/* Article Card Styles */
.article-card {
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, border-color 0.3s;
    background-color: white;
}

.dark .article-card {
    background-color: #1f2937;
    border-color: #374151;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.dark .article-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.category-section {
    scroll-margin-top: 100px;
}

/* Fact-Checking Section Styles */
.fact-checking-section {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    transition: all 0.3s ease;
}

.dark .fact-checking-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-color: #60a5fa;
}

.fact-checking-section:hover {
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.dark .fact-checking-section:hover {
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
}

.fact-check-article {
    background: white;
    transition: all 0.2s ease;
    border-left: 4px solid #3b82f6;
}

.dark .fact-check-article {
    background: #1f2937;
    border-left-color: #60a5fa;
}

.fact-check-article:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.dark .fact-check-article:hover {
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

/* Toast Notification Styles */
.toast {
    min-width: 300px;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.toast.removing {
    animation: slideOut 0.3s ease-in;
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast-progress {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-progress span:first-child {
    animation: spin 1s linear infinite;
}

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

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

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Load More Button */
.load-more-btn {
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Article Fade-in Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-fade-in {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Article Thumbnail Styles */
.article-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background-color: #f3f4f6;
    transition: opacity 0.3s;
}

.dark .article-thumbnail {
    background-color: #374151;
    opacity: 0.9;
}

.article-thumbnail.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .article-thumbnail.loading {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.article-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    color: #9ca3af;
    font-size: 3rem;
    transition: background 0.3s, color 0.3s;
}

.dark .article-thumbnail-placeholder {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    color: #6b7280;
}

/* Tooltip Styles */
.tooltip-trigger {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 300px;
    min-width: 250px;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    animation: tooltipFadeIn 0.2s ease-out;
}

.tooltip-content::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 1rem;
    border: 8px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
}

.tooltip-content.hidden {
    display: none;
}

.tooltip-content.show {
    display: block;
}

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

/* Responsive tooltip adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: 280px;
    }
    
    .tooltip-content::before {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* Search and Filter Styles */
#searchFilterContainer {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

#searchFilterContainer.search-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    transform: scaleY(0);
}

#searchFilterContainer.search-expanded {
    max-height: 500px;
    opacity: 1;
    transform: scaleY(1);
}

#searchInput {
    font-size: 1rem;
}

#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    transition: color 0.3s;
}

.dark .filter-label {
    color: #d1d5db;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: white;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.dark .filter-select {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.filter-select:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.dark .filter-select:hover {
    border-color: #6b7280;
    background-color: #4b5563;
}

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

.dark .filter-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.filter-dropdown {
    position: fixed;
    margin-top: 0.5rem;
    background-color: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark .filter-dropdown {
    background-color: #1f2937;
    border-color: #4b5563;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.filter-dropdown.hidden {
    display: none;
}

.source-checkbox,
.bias-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-checkbox:checked,
.bias-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.source-checkbox:focus,
.bias-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#activeFiltersIndicator {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#resetFiltersBtn {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Responsive adjustments for filters */
@media (max-width: 768px) {
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .filter-dropdown {
        right: 0;
        left: auto;
    }
}

