/* NovaNytt - Fast-Paced News CSS */
/* Dynamic, energetic, news design */

* {
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #ff0033;
    --electric-blue: #00d4ff;
    --neon-green: #00ff88;
    --warning-orange: #ff6600;
    --dark-bg: #0a0a0a;
    --gray-dark: #1a1a1a;
    --gray-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-accent: #ff0033;
    --shadow-neon: 0 0 20px rgba(255, 0, 51, 0.3);
    --shadow-blue: 0 0 20px rgba(0, 212, 255, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--dark-bg);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 51, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-bg) 100%);
    color: var(--text-primary);
    padding: 1.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--primary-red);
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.5);
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: sweep 3s infinite;
}


.site-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(45deg, var(--primary-red), var(--electric-blue), var(--neon-green));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 0, 51, 0.5);
    position: relative;
}

.site-tagline {
    font-size: 1rem;
    font-weight: 600;
    color: var(--electric-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: 70vh;
}

/* Category Filter */
.category-filter {
    background: var(--gray-dark);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-neon);
    border: 1px solid var(--primary-red);
    position: relative;
    overflow: hidden;
}

.category-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-red), var(--electric-blue), var(--neon-green), var(--primary-red));
    background-size: 200% 100%;
    animation: slide-border 2s linear infinite;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-filter h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.active-count {
    background: var(--gray-light);
    color: var(--electric-blue);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--electric-blue);
    animation: glow-blue 2s ease-in-out infinite alternate;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-btn {
    background: var(--gray-light);
    border: 2px solid var(--gray-light);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
}

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

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

.filter-btn:hover {
    background: var(--gray-light);
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-red) 0%, #cc0029 100%);
    border-color: var(--primary-red);
    color: white;
    box-shadow: var(--shadow-neon);
    transform: translateY(-2px);
}

.filter-btn.active::after {
    content: '⚡';
    font-size: 1rem;
    margin-left: 0.3rem;
    animation: pulse-intense 1s infinite;
}

.filter-btn.active:hover {
    background: linear-gradient(135deg, #ff1a4d 0%, var(--primary-red) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 0, 51, 0.4);
}

/* Special styling for "Alle" button */
.filter-btn[data-category="all"].active::after {
    content: '🔥';
    font-size: 1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* News Cards */
.news-card {
    background: var(--gray-dark);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-light);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-red), var(--electric-blue));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

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

.news-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-neon);
    border-color: var(--primary-red);
}

.news-card:nth-child(even):hover {
    box-shadow: var(--shadow-blue);
    border-color: var(--electric-blue);
}

.news-card:nth-child(3n):hover {
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
    border-color: var(--neon-green);
}

/* Card Header */
.card-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 1rem;
    position: relative;
}


.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
    line-height: 1.3;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.news-card:hover .article-title {
    color: var(--electric-blue);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    gap: 1rem;
}

.category {
    background: linear-gradient(135deg, var(--primary-red), #cc0029);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
    box-shadow: 0 2px 10px rgba(255, 0, 51, 0.3);
    position: relative;
    overflow: hidden;
}

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

.timestamp {
    font-weight: 500;
    color: var(--electric-blue);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

/* Article Content */
.article-teaser {
    margin-bottom: 1.2rem;
}

.article-teaser p {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--gray-light);
    padding: 1.2rem;
    border-radius: 10px;
    border-left: 4px solid var(--electric-blue);
    border-right: 4px solid var(--primary-red);
    position: relative;
    line-height: 1.5;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}


/* Bullet Points */
.article-bullets ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--gray-light);
    border-radius: 10px;
    padding: 0.5rem 0;
}

.article-bullets li {
    position: relative;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.article-bullets li:last-child {
    border-bottom: none;
}

.article-bullets li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding-left: 3rem;
}

.article-bullets li::before {
    content: '⚡';
    position: absolute;
    left: 1rem;
    color: var(--neon-green);
    font-weight: bold;
    font-size: 1rem;
    animation: pulse-soft 2s infinite;
}

/* Article Content */
.article-content {
    margin-top: 2rem;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* Error and No Articles */
.error-message,
.no-articles {
    text-align: center;
    padding: 3rem;
    background: var(--gray-dark);
    border-radius: 15px;
    box-shadow: var(--shadow-neon);
    border: 1px solid var(--primary-red);
}

.error-message p,
.no-articles p {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background: var(--gray-dark);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid var(--primary-red);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-red), var(--electric-blue), var(--neon-green), var(--primary-red));
    background-size: 200% 100%;
    animation: slide-border 3s linear infinite;
}

.site-footer a {
    color: var(--electric-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.site-footer a:hover {
    color: var(--primary-red);
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .news-card {
        padding: 1.25rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .category-filter {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .site-header {
        padding: 1.5rem 0;
    }
    
    .news-card {
        padding: 1rem;
    }
}

/* Dynamic Animations */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-intense {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 0, 51, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 0, 51, 0.8);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 0, 51, 0.3);
    }
}

@keyframes pulse-soft {
    0% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
    100% { 
        opacity: 0.7;
        transform: scale(1);
    }
}

@keyframes glow-blue {
    from { 
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
        text-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
    }
    to { 
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
        text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    }
}

@keyframes sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes slide-border {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* Pagination Styles */
.pagination {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 2px solid var(--border-color);
}

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

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    min-width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.pagination-link:hover {
    background: linear-gradient(135deg, var(--primary-red), #cc0029);
    color: white;
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 51, 0.3);
}

.pagination-link.active {
    background: linear-gradient(135deg, var(--primary-red), #cc0029);
    color: white;
    border-color: var(--primary-red);
    box-shadow: 0 2px 10px rgba(255, 0, 51, 0.3);
    cursor: default;
}

.pagination-link.prev,
.pagination-link.next {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 700;
}

.pagination-link.prev:hover,
.pagination-link.next:hover {
    background: linear-gradient(135deg, var(--electric-blue), #00a8cc);
    border-color: var(--electric-blue);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 0.5rem;
    font-weight: 600;
}

.pagination-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.pagination-info p {
    margin: 0;
    font-weight: 500;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        gap: 0.5rem;
    }
    
    .pagination-link {
        padding: 0.4rem 0.8rem;
        min-width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
    
    .pagination-link.prev,
    .pagination-link.next {
        padding: 0.4rem 1rem;
    }
}

@keyframes news-ticker {
    0% { 
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        transform: translateX(0);
        opacity: 1;
    }
    90% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 2s infinite;
}

/* News Ticker */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-red);
    color: white;
    padding: 0.5rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    animation: news-ticker 10s infinite;
    transform: translateX(-100%);
}

/* Staggered animation delays for cards */
.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; }

/* Performance optimizations */
.news-card {
    contain: layout style;
    will-change: transform;
    content-visibility: auto;
    contain-intrinsic-size: 0 300px;
}

.articles-grid {
    contain: layout style;
}

/* Critical CSS for above-the-fold */
.site-header {
    contain: layout style;
}

.category-filter {
    contain: layout style;
}

/* Reduce animation complexity on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration for smooth animations */
.site-title,
.filter-btn,
.news-card,
.energy-bar {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize font loading */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('data:,') format('woff2');
}

/* Dark mode energy bars */
.energy-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-red), var(--electric-blue), var(--neon-green));
    background-size: 100% 300%;
    animation: slide-border 2s linear infinite;
    z-index: 1000;
}

.energy-bar:nth-child(2) {
    right: 0;
    left: auto;
    animation-delay: 1s;
}