/* Articles page specific styles */
.articles-hero {
    margin-top: 80px !important;
    background: linear-gradient(109.6deg, rgb(20, 30, 48) 11.2%, rgb(36, 59, 85) 91.1%);
    padding: 2rem 0;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.articles-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .articles-hero {
        margin-top: 70px !important;
        padding: 1rem 0;
    }
}

.articles-intro {
    position: relative;
    z-index: 2;
}

.articles-intro h1 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.articles-intro .lead {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Section Toggle Buttons */
.section-toggle {
    background: var(--background-color);
    padding: 2rem 0;
    position: relative;
}

.section-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.toggle-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.toggle-btn {
    min-width: 200px;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition-smooth);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.toggle-btn {
    background: var(--surface-light);
    color: var(--text-muted);
}

.toggle-btn.active::before {
    left: 0;
}

.toggle-btn.active {
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.toggle-btn:hover::before {
    left: 0;
}

.toggle-btn:hover {
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .toggle-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .toggle-btn {
        width: 80%;
        min-width: auto;
    }
}

/* Articles Sections */
.articles-section {
    background: var(--background-color);
    padding: 4rem 0;
    position: relative;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.articles-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

.articles-section h2 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.articles-section .lead {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Enhanced Article Cards */
.article-card {
    background: var(--surface-color);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    height: 100%;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-secondary);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1;
}

.article-card:hover::before {
    opacity: 0.05;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.article-card-img-wrapper {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.article-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.article-card:hover .article-card-img {
    filter: brightness(1.05);
}

.article-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 40%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.95) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

.article-card:hover .article-card-overlay {
    opacity: 1;
}

.article-overlay-content {
    color: white;
    z-index: 2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}

.article-overlay-content h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    line-height: 1.3;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.8);
}

.article-overlay-content p {
    margin-bottom: 1rem;
    opacity: 1;
    line-height: 1.4;
    font-size: 0.9rem;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.7);
}

.article-overlay-content .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: var(--transition-smooth);
}

.article-overlay-content .btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

.article-card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.article-card-title {
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.article-card-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.article-meta p {
    margin-bottom: 0.25rem;
}

.article-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.article-tech-badge {
    background: var(--surface-light);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.article-tech-badge:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-card-link {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: var(--transition-smooth);
}

.article-card-link:hover {
    color: var(--secondary-color);
}

/* Article Categories */
.article-category-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.article-category-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
}

/* Special styling for scientific articles */
.scientific-articles .article-category-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.scientific-articles .article-tech-badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
}

/* Special styling for game articles */
.game-articles .article-category-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.game-articles .article-tech-badge.bg-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    border: none;
}

/* Loading States */
.article-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.article-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 992px) {
    .article-card-img-wrapper {
        height: 220px;
    }
    
    .articles-section {
        padding: 3rem 0;
    }
}

@media (max-width: 768px) {
    .article-card-img-wrapper {
        height: 200px;
    }
    
    .article-card-overlay {
        padding: 1rem;
    }
    
    .article-overlay-content h5 {
        font-size: 1.1rem;
    }
    
    .article-card-body {
        padding: 1rem;
    }
    
    .articles-section {
        padding: 2rem 0;
    }
    
    .section-toggle {
        padding: 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .article-card-img-wrapper {
        height: 180px;
    }
    
    .article-tech-stack {
        justify-content: center;
    }
    
    .article-card-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .article-overlay-content h5 {
        font-size: 1rem;
    }
    
    .article-meta {
        font-size: 0.8rem;
    }
}

/* Animation delays for staggered entrance */
.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

/* Accessibility improvements */
.article-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.toggle-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .article-card {
        border: 2px solid var(--text-color);
    }
    
    .article-tech-badge {
        border: 2px solid var(--border-color);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .toggle-btn,
    .article-card-img,
    .article-card-overlay {
        transition: none;
    }
    
    .article-category-icon {
        animation: none;
    }
    
    .article-card:hover {
        transform: none;
    }
    
    .toggle-btn:hover {
        transform: none;
    }
}

/* Search functionality styles */
.article-search {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 400px;
    margin: 0 auto 2rem;
}

.article-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.article-search::placeholder {
    color: var(--text-muted);
}

/* Filter tags */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-tag {
    background: var(--surface-light);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Article stats */
.article-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface-color);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification-content {
    display: flex;
    align-items: center;
}

.notification.notification-success {
    border-color: var(--success-color);
}

.notification.notification-warning {
    border-color: var(--warning-color);
}

.notification.notification-error {
    border-color: var(--error-color);
}

/* Lazy loading placeholder */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Article card hover effects enhancement */
.article-card:hover .article-card-title {
    color: var(--primary-color);
}

.article-card:hover .article-tech-badge {
    transform: scale(1.05);
}

/* Print styles */
@media print {
    .articles-hero,
    .section-toggle,
    .toggle-buttons,
    .article-card-overlay,
    .notification {
        display: none !important;
    }
    
    .articles-section {
        background: white !important;
        padding: 1rem 0 !important;
    }
    
    .article-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }
    
    .article-card-img-wrapper {
        height: 150px !important;
    }
    
    .article-card-body {
        padding: 1rem !important;
    }
    
    .article-card-title,
    .article-card-description,
    .article-meta {
        color: black !important;
    }
    
    .article-tech-badge {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #ddd !important;
    }
    
    .article-card-link {
        display: none;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .article-search {
        background: var(--surface-dark);
    }
    
    .article-stats {
        background: var(--surface-dark);
    }
    
    .filter-tag {
        background: var(--surface-dark);
    }
}

/* Focus management for keyboard navigation */
.article-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.article-card:focus-within .article-card-link {
    color: var(--secondary-color);
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Skeleton loading for article cards */
.article-card.skeleton {
    pointer-events: none;
}

.article-card.skeleton .article-card-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.article-card.skeleton .article-card-title,
.article-card.skeleton .article-card-description {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltip styles for tech badges */
.article-tech-badge[data-tooltip] {
    position: relative;
    cursor: help;
}

.article-tech-badge[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-dark);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.article-tech-badge[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--surface-dark);
    z-index: 1000;
}

/* Scroll to top button for long article lists */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.article-meta-header {
    margin-top: 2rem;
}

.meta-item {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meta-item i {
    color: var(--primary-color);
}

.article-toc .card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
}

.toc-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    transition: var(--transition-smooth);
    border-left: 3px solid transparent;
    padding-left: 1rem;
}

.toc-link:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 1.5rem;
}

.section-title {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.article-navigation {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

@media (max-width: 768px) {
    .meta-item {
        justify-content: flex-start;
        font-size: 0.9rem;
    }
    
    .article-navigation .text-end {
        text-align: start !important;
        margin-top: 1rem;
    }
}
.game-article-content {
    max-width: 860px;
    margin: 0 auto;
    color: var(--text-color, #e8e8e8);
    font-size: 1.05rem;
    line-height: 1.8;
}

.game-articles .article-card-img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
}

.game-article-toc .toc {
    font-size: 0.9rem;
}

.game-article-toc .article-toc {
    top: 100px;
}

.game-article-toc ul {
    margin: 0;
    padding-left: 1.1rem;
}

.game-article-toc li + li {
    margin-top: 0.55rem;
}

.game-article-toc a {
    color: var(--text-muted, #aaa);
    text-decoration: none;
}

.game-article-toc a:hover {
    color: var(--primary-color, #6c63ff);
}

.game-article-content > * + * {
    margin-top: 1.25rem;
}

.game-article-content h1,
.game-article-content h2,
.game-article-content h3,
.game-article-content h4 {
    margin-top: 2rem;
    line-height: 1.3;
}

.game-article-content :is(h2, h3, h4, h5, h6) {
    scroll-margin-top: calc(var(--header-height, 76px) + 1rem);
}

.game-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
}

.game-article-content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #101722;
}

.game-article-content blockquote {
    padding-left: 1rem;
    border-left: 3px solid var(--primary-color, #6c63ff);
    color: var(--text-muted, #aaa);
}