/* ============================================
   MAJIN — IT Security & Gaming Theme
   Dark Edition
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-nav: rgba(10, 10, 15, 0.95);
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    
    /* Accents */
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.15);
    --green: #00ff88;
    --green-dim: rgba(0, 255, 136, 0.15);
    --red: #ff3355;
    --red-dim: rgba(255, 51, 85, 0.15);
    --orange: #ff8800;
    --orange-dim: rgba(255, 136, 0, 0.15);
    --purple: #8844ff;
    --purple-dim: rgba(136, 68, 255, 0.15);
    
    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--cyan), var(--green));
    --gradient-red: linear-gradient(135deg, var(--red), var(--orange));
    --gradient-purple: linear-gradient(135deg, var(--purple), var(--cyan));
    
    /* UI */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul { list-style: none; }

img { max-width: 100%; }

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

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow-cyan {
    box-shadow: 0 0 20px var(--cyan-dim), 0 0 40px var(--cyan-dim);
}

.glow-green {
    box-shadow: 0 0 20px var(--green-dim), 0 0 40px var(--green-dim);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { 
    background: var(--border-hover); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-accent {
    color: var(--cyan);
    font-weight: 300;
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-menu li a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-menu li a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--gradient-main);
    border-radius: 1px;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, var(--cyan-dim) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, var(--green-dim) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, var(--purple-dim) 0%, transparent 50%);
    opacity: 0.6;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.highlight-cyan { color: var(--cyan); }
.highlight-green { color: var(--green); }

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-main);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Hero Scroll */
.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    font-size: 1.2rem;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 48px;
}

.categories {
    padding: 100px 0;
    background: var(--bg-secondary);
    position: relative;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-card {
    position: relative;
    padding: 32px 28px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-it::before { background: var(--gradient-main); }
.card-valo::before { background: var(--red); }
.card-cod::before { background: var(--orange); }
.card-rust::before { background: var(--orange); background: linear-gradient(135deg, var(--orange), #cc4400); }

.category-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.category-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.category-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.category-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
}

.card-tag {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ============================================
   LATEST POSTS
   ============================================ */
.latest-posts {
    padding: 100px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-card {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.post-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.post-card .post-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.cat-it { background: var(--cyan-dim); color: var(--cyan); }
.cat-valo { background: var(--red-dim); color: var(--red); }
.cat-cod { background: var(--orange-dim); color: var(--orange); }
.cat-rust { background: rgba(255, 136, 0, 0.15); color: var(--orange); }

.post-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card .post-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.post-card .post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.post-card .post-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-card .read-more {
    color: var(--cyan);
    font-weight: 500;
}

.post-card .read-more:hover {
    color: var(--green);
}

/* Placeholder loading */
.post-card.placeholder .post-loader {
    height: 80px;
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.03) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

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

/* ============================================
   CATEGORY PAGES
   ============================================ */
.category-page {
    padding: 120px 20px 60px;
    min-height: 100vh;
}

.category-header {
    text-align: center;
    margin-bottom: 48px;
}

.category-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 12px;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================
   FULL ARTICLE (single post)
   ============================================ */
.article-page {
    padding: 120px 20px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 32px;
}

.article-header h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.article-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--cyan);
}

.article-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--cyan);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo-accent {
    font-family: var(--font-mono);
    font-size: 1.3rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

.footer-links h4,
.footer-social h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--cyan);
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    color: var(--cyan);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-110%);
        opacity: 0;
        transition: all 0.4s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }

    .nav-menu li a {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 16px 40px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Sources & Veille */
.sources-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--border-color);
}

.sources-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.95rem;
}

.sources-grid {
    max-width: 900px;
    margin: 0 auto;
}

.source-group {
    margin-bottom: 36px;
}

.source-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    padding-left: 4px;
}

.source-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
}

.source-item:hover {
    border-color: var(--cyan);
    transform: translateX(4px);
    background: rgba(0, 212, 255, 0.03);
}

.source-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.source-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.source-rss {
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.source-item:hover .source-rss {
    opacity: 1;
}

.source-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.source-item:hover .source-arrow {
    transform: translateX(4px);
    color: var(--cyan);
}

/* RSS Feeds - Articles */
.rss-section {
    margin-top: 60px;
    margin-bottom: 60px;
}

.rss-header {
    text-align: center;
    margin-bottom: 32px;
}

.rss-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.rss-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.rss-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.rss-loading .post-loader {
    height: 40px;
    width: 200px;
    margin: 0 auto 16px;
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.03) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.rss-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.rss-article-card {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rss-article-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.rss-article-source {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cyan);
    padding: 2px 8px;
    background: var(--cyan-dim);
    border-radius: 4px;
    align-self: flex-start;
}

.rss-article-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.rss-article-card h4 a {
    color: var(--text-primary);
    text-decoration: none;
}

.rss-article-card h4 a:hover {
    color: var(--cyan);
}

.rss-article-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rss-article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.rss-article-meta .read-more {
    font-size: 0.75rem;
}

.rss-sources-used {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rss-sources-used a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rss-sources-used a:hover {
    color: var(--cyan);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-size: 1rem;
}
