/* ========================================
   🌌 CYBERPUNK THEME - DARK TRON MODE
   ======================================== */

:root {
    /* Core Colors */
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: #0f0f0f;

    /* Neon Colors */
    --neon-cyan: #00d4ff;
    --neon-magenta: #ff00ff;
    --neon-green: #00ff88;
    --neon-red: #ff0055;
    --neon-blue: #0088ff;

    /* Category Colors */
    --cat-ia: var(--neon-blue);
    --cat-security: var(--neon-green);
    --cat-threats: var(--neon-red);
    --cat-hacker: var(--neon-magenta);
    --cat-privacy: var(--neon-cyan);

    /* Text */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;

    /* Effects */
    --glow-sm: 0 0 8px;
    --glow-md: 0 0 16px;
    --glow-lg: 0 0 24px;
    --transition-fast: 200ms ease-out;
    --transition-normal: 300ms ease-out;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   🌀 ANIMATED BACKGROUND GRID
   ======================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========================================
   🎯 HERO SECTION WITH TYPING EFFECT
   ======================================== */

.hero {
    position: relative;
    padding: 120px 20px 80px;
    text-align: center;
    background: linear-gradient(180deg,
            rgba(0, 136, 255, 0.05) 0%,
            transparent 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typing-text {
    display: inline-block;
    position: relative;
}

.typing-text::after {
    content: '|';
    position: absolute;
    right: -8px;
    color: var(--neon-cyan);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ========================================
   🔍 SEARCH BAR
   ======================================== */

.search-container {
    max-width: 600px;
    margin: 2rem auto 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ========================================
   💠 CATEGORY PILLS (ANIMATED)
   ======================================== */

.category-filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

.filter-pill {
    padding: 10px 24px;
    border: 2px solid transparent;
    border-radius: 50px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.filter-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.filter-pill:hover::before {
    opacity: 1;
}

.filter-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-md) rgba(0, 212, 255, 0.3);
}

.filter-pill.active {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-sm) var(--neon-cyan);
}

/* Category specific colors */
.filter-pill[data-category="ia"] {
    --pill-color: var(--cat-ia);
}

.filter-pill[data-category="seguranca"] {
    --pill-color: var(--cat-security);
}

.filter-pill[data-category="ameacas"] {
    --pill-color: var(--cat-threats);
}

.filter-pill[data-category="hacker"] {
    --pill-color: var(--cat-hacker);
}

.filter-pill[data-category="privacidade"] {
    --pill-color: var(--cat-privacy);
}

/* ========================================
   🟦 PREMIUM GRID 4×8 (32 POSTS)
   ======================================== */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   🎴 ARTICLE CARDS (PREMIUM)
   ======================================== */

.article-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

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

/* Stagger animation */
.article-card:nth-child(1) {
    animation-delay: 0.05s;
}

.article-card:nth-child(2) {
    animation-delay: 0.1s;
}

.article-card:nth-child(3) {
    animation-delay: 0.15s;
}

.article-card:nth-child(4) {
    animation-delay: 0.2s;
}

.article-card:nth-child(5) {
    animation-delay: 0.25s;
}

.article-card:nth-child(6) {
    animation-delay: 0.3s;
}

.article-card:nth-child(7) {
    animation-delay: 0.35s;
}

.article-card:nth-child(8) {
    animation-delay: 0.4s;
}

.article-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow:
        var(--glow-md) rgba(0, 212, 255, 0.2),
        0 12px 40px rgba(0, 0, 0, 0.5);
}

.article-card:hover~.article-card {
    opacity: 0.6;
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
}

.article-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 20px;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.article-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.article-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.article-date::before {
    content: '📅 ';
}

.article-read-time::before {
    content: '⏱️ ';
}

/* ========================================
   ⚡ NEON BUTTONS
   ======================================== */

.btn-neon {
    padding: 12px 32px;
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    background: transparent;
    color: var(--neon-cyan);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

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

.btn-neon:hover {
    box-shadow: var(--glow-md) var(--neon-cyan);
    transform: translateY(-2px);
}

.btn-neon:active {
    transform: translateY(0);
}

/* ========================================
   🔁 LOADING SCREEN (SOC STYLE)
   ======================================== */

.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-scanner {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-scanner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(300%);
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* ========================================
   📱 RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .hero {
        padding: 80px 20px 60px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    body::before {
        display: none;
        /* Disable particles on mobile */
    }
}


/* ========================================
   🍪 COOKIE BANNER
   ======================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-top: 2px solid var(--neon-cyan);
    padding: 1.5rem;
    z-index: 10000;
    animation: slideUp 0.5s ease;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-content p {
    margin: 0;
    color: var(--text-secondary);
    flex: 1;
    min-width: 300px;
}

.cookie-content a {
    text-decoration: underline;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ========================================
   🌐 LANGUAGE SELECTOR
   ======================================== */

.language-selector {
    position: fixed;
    top: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.lang-btn {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
}

.lang-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.1);
}

.lang-btn.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

@media (max-width: 768px) {
    .language-selector {
        top: auto;
        bottom: 80px;
        right: 10px;
        flex-direction: row;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}
