/* ============================================
   MATRIX MAGAZINE - MODERN THEME (COMPLET)
   Neon, Glassmorphism & Cyberpunk Aesthetic
   ============================================ */

/* === VARIABLES === */
:root {
    --matrix-green: #00ff41;
    --matrix-dark: #0a0f0a;
    --matrix-darker: #050805;
    --matrix-glow: 0 0 5px #00ff41, 0 0 10px #00ff41, 0 0 20px rgba(0,255,65,0.5);
    --matrix-glow-soft: 0 0 3px #00ff41, 0 0 8px rgba(0,255,65,0.3);
    --transition-fast: 0.2s ease;
    --transition-slow: 0.4s ease;
}

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

body {
    background: linear-gradient(135deg, var(--matrix-darker) 0%, #000000 100%);
    color: var(--matrix-green);
    font-family: 'Courier New', 'Fira Code', 'Source Code Pro', monospace;
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
}

/* === MATRIX RAIN EFFECT ORIGINAL (AMÉLIORÉ) === */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 65, 0.03) 0px,
        rgba(0, 255, 65, 0.03) 2px,
        transparent 2px,
        transparent 8px
    );
    pointer-events: none;
    z-index: -1;
}

/* Effet de pluie verticale supplémentaire */
.matrix-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        rgba(0, 255, 65, 0.02) 0px,
        rgba(0, 255, 65, 0.02) 1px,
        transparent 1px,
        transparent 10px
    );
}

.matrix-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(0,255,65,0.08) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--matrix-darker);
    border-left: 1px solid var(--matrix-green);
}

::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc33;
}

/* === TYPOGRAPHIE GLOBALE === */
h1, h2, h3, h4 {
    font-weight: normal;
    letter-spacing: 1px;
}

/* === CONTAINER PRINCIPAL === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    position: relative;
}

@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }
}

/* === HEADER === */
header {
    padding: 30px 0 20px;
    border-bottom: 1px solid var(--matrix-green);
    margin-bottom: 40px;
    position: relative;
    background: linear-gradient(180deg, rgba(0,255,65,0.05) 0%, transparent 100%);
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--matrix-green), transparent);
}

header h1 a {
    color: var(--matrix-green);
    text-decoration: none;
    font-size: 2.8rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: var(--matrix-glow);
    transition: var(--transition-fast);
    font-weight: 300;
}

header h1 a:hover {
    letter-spacing: 10px;
    text-shadow: 0 0 8px #00ff41, 0 0 15px #00ff41;
}

/* === NAVIGATION AVEC EFFET TERMINAL === */
nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin-top: 25px;
    flex-wrap: wrap;
}

nav ul li a {
    color: var(--matrix-green);
    text-decoration: none;
    padding: 8px 18px;
    border: 1px solid var(--matrix-green);
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    transition: var(--transition-fast);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

nav ul li a::before {
    content: '>';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: var(--transition-fast);
}

nav ul li a:hover::before {
    left: 10px;
    opacity: 1;
}

nav ul li a:hover {
    background: var(--matrix-green);
    color: #000;
    box-shadow: var(--matrix-glow);
    transform: translateY(-2px);
    padding-left: 28px;
}

/* === SECTION TRI === */
.sort-options {
    margin-bottom: 30px;
    padding: 15px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px dashed rgba(0, 255, 65, 0.3);
}

.sort-options span {
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--matrix-green);
    border-radius: 20px;
    color: var(--matrix-green);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    display: inline-block;
}

.btn-small:hover {
    background: var(--matrix-green);
    color: #000;
    box-shadow: var(--matrix-glow-soft);
    transform: translateY(-1px);
}

/* === CARTES ARTICLES === */
.articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.article-card {
    background: rgba(10, 15, 10, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 16px;
    padding: 25px;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--matrix-green), transparent);
    transition: var(--transition-slow);
}

.article-card:hover {
    border-color: var(--matrix-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.15);
}

.article-card:hover::before {
    left: 100%;
}

.article-card h2 {
    margin-bottom: 15px;
    font-size: 1.6rem;
    position: relative;
}

.article-card h2 a {
    color: var(--matrix-green);
    text-decoration: none;
    transition: var(--transition-fast);
    background: linear-gradient(120deg, var(--matrix-green), #00cc33);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.article-card h2 a:hover {
    background-position: 100% 0;
}

/* Métadonnées */
.article-meta {
    font-size: 0.8rem;
    color: #88ff88;
    margin: 12px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.article-meta a {
    color: #88ff88;
    text-decoration: none;
    border-bottom: 1px dotted rgba(0, 255, 65, 0.5);
}

.article-meta a:hover {
    color: var(--matrix-green);
    border-bottom-color: var(--matrix-green);
}

.category {
    background: rgba(0, 255, 65, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid rgba(0, 255, 65, 0.5);
    transition: var(--transition-fast);
}

.category:hover {
    background: rgba(0, 255, 65, 0.3);
    transform: scale(1.02);
}

.article-excerpt {
    margin: 20px 0;
    color: #cccccc;
    line-height: 1.5;
}

/* === BOUTONS GÉNÉRIQUES === */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--matrix-green);
    border-radius: 30px;
    color: var(--matrix-green);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    font-family: monospace;
    font-size: 0.85rem;
}

.btn:hover {
    background: var(--matrix-green);
    color: #000;
    box-shadow: var(--matrix-glow);
    transform: translateX(5px);
}

/* === MESSAGES D'ERREUR/SUCCÈS === */
.error-message, [style*="color:#f00"], [style*="color:red"] {
    color: #ff4444 !important;
    background: rgba(255, 0, 0, 0.1);
    border-left: 3px solid #ff4444;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.success-message, [style*="color:#0f0"], [style*="color:green"] {
    color: #00ff41 !important;
    background: rgba(0, 255, 65, 0.1);
    border-left: 3px solid #00ff41;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

/* === PAGE ARTICLE COMPLET === */
.article-full {
    background: rgba(10, 15, 10, 0.92);
    backdrop-filter: blur(5px);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
}

.article-full h1, 
.article-full h2, 
.article-full h3, 
.article-full h4 {
    color: var(--matrix-green);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.article-full h1 {
    font-size: 2.5rem;
    border-left: 4px solid var(--matrix-green);
    padding-left: 20px;
}

.article-full h2 {
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 8px;
}

.article-full h3 {
    color: #88ff88;
}

.article-full p {
    margin: 1em 0;
}

.article-full a {
    color: #00ff88;
    text-decoration: none;
    border-bottom: 1px dotted #00ff88;
}

.article-full a:hover {
    color: #00ff41;
    border-bottom-color: #00ff41;
}

.article-full pre {
    background: #0a0f0a;
    border-left: 3px solid var(--matrix-green);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-full code {
    background: #0a0f0a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #00ff88;
}

.article-full blockquote {
    border-left: 3px solid var(--matrix-green);
    margin: 20px 0;
    padding: 10px 20px;
    background: rgba(0, 255, 65, 0.05);
    font-style: italic;
}

.article-full img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

.article-full ul, .article-full ol {
    margin: 1em 0;
    padding-left: 2em;
}

.article-full li {
    margin: 0.5em 0;
}

/* === SECTION COMMENTAIRES === */
.comment-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
}

.comment-section h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--matrix-green);
}

.comment-form {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 65, 0.3);
    margin-bottom: 30px;
}

.comment-form input, 
.comment-form textarea {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.5);
    color: var(--matrix-green);
    padding: 12px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    font-family: monospace;
    transition: var(--transition-fast);
}

.comment-form input:focus, 
.comment-form textarea:focus {
    outline: none;
    border-color: var(--matrix-green);
    box-shadow: var(--matrix-glow-soft);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: rgba(0, 255, 65, 0.4);
    font-family: monospace;
}

.comment-form button {
    background: var(--matrix-green);
    color: #000;
    border: none;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-family: monospace;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.comment-form button:hover {
    transform: scale(1.02);
    box-shadow: var(--matrix-glow);
}

.comment-list {
    margin-top: 30px;
}

.comment-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    transition: var(--transition-fast);
}

.comment-item:hover {
    border-color: rgba(0, 255, 65, 0.5);
    transform: translateX(5px);
}

.comment-meta {
    font-size: 0.8rem;
    color: #88ff88;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(0, 255, 65, 0.3);
}

.comment-meta strong {
    color: var(--matrix-green);
}

/* === FOOTER === */
footer {
    margin-top: 70px;
    padding: 30px 0 20px;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
    color: rgba(0, 255, 65, 0.6);
}

/* === ANIMATIONS === */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.matrix-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: var(--matrix-green);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

/* === STYLES ADMIN (rajoutés) === */
.admin-section {
    margin-bottom: 40px;
    border: 1px solid rgba(0, 255, 65, 0.3);
    padding: 15px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
}

.admin-section h2, .admin-section h3 {
    color: var(--matrix-green);
    margin-bottom: 15px;
}

.admin-section table {
    width: 100%;
    border-collapse: collapse;
}

.admin-section th, 
.admin-section td {
    border: 1px solid rgba(0, 255, 65, 0.3);
    padding: 8px;
    text-align: left;
}

.admin-section th {
    background: rgba(0, 255, 65, 0.1);
}

.admin-section form input,
.admin-section form textarea {
    width: 100%;
    margin: 5px 0;
    background: #000;
    color: var(--matrix-green);
    border: 1px solid #0f0;
    padding: 8px;
    font-family: monospace;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .articles-list {
        grid-template-columns: 1fr;
    }
    
    .article-full {
        padding: 20px;
    }
    
    .article-full h1 {
        font-size: 1.8rem;
    }
    
    header h1 a {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
    
    nav ul {
        gap: 12px;
    }
    
    nav ul li a {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    .sort-options {
        gap: 10px;
    }
    
    .btn-small {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

/* === PRINT STYLES === */
@media print {
    .matrix-bg, nav, .comment-section, footer, .sort-options {
        display: none;
    }
    
    .article-full {
        background: white;
        color: black;
        padding: 0;
    }
    
    .article-full h1, .article-full h2 {
        color: black;
    }
}