/* Custom Styles for News Portal */

* {
    font-family: 'Inter', sans-serif;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hide scrollbar for categories */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Category buttons */
.category-btn {
    background: #e5e7eb;
    color: #374151;
    transition: all 0.3s ease;
}

.dark .category-btn {
    background: #374151;
    color: #d1d5db;
}

.category-btn:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.dark .category-btn:hover {
    background: #4b5563;
}

.category-btn.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.dark .category-btn.active {
    background: #3b82f6;
}

/* News Card Animations */
.news-card {
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* List View Styles */
.list-view {
    display: flex !important;
    flex-direction: column !important;
}

.list-view .news-card {
    display: flex !important;
    flex-direction: row !important;
}

.list-view .news-card img {
    width: 280px !important;
    height: 200px !important;
    flex-shrink: 0;
}

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

/* Pulse Animation for Breaking News */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Responsive Image */
img {
    max-width: 100%;
    height: auto;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-tecnologia {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .badge-tecnologia {
    background-color: #1e3a8a;
    color: #93c5fd;
}

.badge-esportes {
    background-color: #dcfce7;
    color: #166534;
}

.dark .badge-esportes {
    background-color: #14532d;
    color: #86efac;
}

.badge-economia {
    background-color: #fef3c7;
    color: #92400e;
}

.dark .badge-economia {
    background-color: #78350f;
    color: #fde68a;
}

.badge-entretenimento {
    background-color: #fae8ff;
    color: #86198f;
}

.dark .badge-entretenimento {
    background-color: #701a75;
    color: #f0abfc;
}

.badge-saude {
    background-color: #fecdd3;
    color: #9f1239;
}

.dark .badge-saude {
    background-color: #881337;
    color: #fda4af;
}

.badge-ciencia {
    background-color: #e0e7ff;
    color: #3730a3;
}

.dark .badge-ciencia {
    background-color: #312e81;
    color: #c7d2fe;
}

/* Hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Custom gradient text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Menu Animation */
@media (max-width: 768px) {
    #searchInput {
        width: 100% !important;
    }

    .mobile-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-menu.active {
        max-height: 500px;
    }
}

/* Floating Action Button */
.fab-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 40;
}

.fab-button:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

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

.no-results i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.dark .no-results i {
    color: #4b5563;
}

/* Print styles */
@media print {

    header,
    footer,
    button,
    .category-btn,
    #themeToggle {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* Extra Mobile Optimizations */
@media (max-width: 640px) {
    .list-view .news-card {
        flex-direction: column !important;
    }

    .list-view .news-card img {
        width: 100% !important;
        height: 200px !important;
    }

    /* Ensure categories don't touch edges */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Fix global overflow on mobile */
body {
    overflow-x: hidden;
    width: 100%;
}