/* ==========================================================================
   PALETTE OSINT / HITEC - BA7ATH PROJECT
   ========================================================================== */
:root {
    --bg-deep: #050a14;       /* Noir bleuté très profond */
    --bg-card: #0f172a;       /* Bleu nuit pour les éléments */
    --text-main: #e2e8f0;     /* Blanc cassé pour la lecture */
    --text-muted: #94a3b8;    /* Gris bleuté */
    
    --neon-blue: #0ea5e9;     /* Cyan électrique */
    --neon-glow: rgba(14, 165, 233, 0.4); 
    --neon-cyan: #0dcaf0;
    --danger-red: #ef4444;    /* Rouge alerte pour les éléments critiques */
}

/* ==========================================================================
   STRUCTURE GLOBALE
   ========================================================================== */
body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    background-image: 
        linear-gradient(rgba(5, 10, 20, 0.95), rgba(5, 10, 20, 0.95)),
        url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
    overflow-x: hidden;
    font-family: 'Cairo', sans-serif;
}

/* --- TYPOGRAPHIE & GRADIENTS --- */
h1, h2, h3, .navbar-brand, .text-gradient {
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ==========================================================================
   COMPOSANTS UI (NAVBAR, CARTES, BOUTONS)
   ========================================================================== */

/* --- NAVBAR GLASSMORPHISM --- */
.navbar {
    background: rgba(5, 10, 20, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.nav-link {
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    color: var(--neon-blue) !important;
    text-shadow: 0 0 8px var(--neon-glow);
}

/* --- LOGO CYBER --- */
.cyber-logo {
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
    transition: all 0.3s ease;
}

.cyber-logo:hover {
    text-shadow: 0 0 20px rgba(13, 110, 253, 0.8);
    transform: skewX(-5deg);
}

.blink {
    animation: blinker 1.2s step-end infinite;
    color: var(--neon-cyan);
    font-weight: bold;
}

@keyframes blinker { 50% { opacity: 0; } }

/* --- CARTES & ARTICLES --- */
.card, .hover-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.hover-card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: var(--neon-blue) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 15px var(--neon-glow);
}

.card-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.transition-zoom {
    transition: transform 0.6s ease;
}

.hover-card:hover .transition-zoom {
    transform: scale(1.08);
}

/* --- BOUTONS --- */
.btn-primary {
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--neon-blue);
    color: white;
    box-shadow: 0 0 20px var(--neon-glow);
    transform: translateY(-2px);
}

/* ==========================================================================
   NOUVEAU DESIGN "NEWSROOM" & HERO SECTION (INDISPENSABLE)
   ========================================================================== */

/* L'image de fond du Hero */
.hero-image-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.8s ease;
}

/* Le dégradé sombre par-dessus l'image */
.hero-overlay-gradient {
    position: absolute;
    top: 0;
    right: 0; 
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, rgba(5,10,20,0) 0%, rgba(5,10,20,0.9) 60%, rgba(5,10,20,1) 100%);
    pointer-events: none;
}

/* Animation Zoom au survol */
.hero-card:hover .hero-image-bg {
    transform: scale(1.05);
}

/* Badges Néons */
.bg-neon {
    background-color: var(--neon-blue);
    color: #000 !important;
    box-shadow: 0 0 10px var(--neon-glow);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Cartes Translucides (Glassmorphism pour les graphiques) */
.bg-dark-transparent {
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.object-fit-cover {
    object-fit: cover;
}

/* ==========================================================================
   BILINGUISME & LOCALISATION (RTL/LTR)
   ========================================================================== */

.article-meta-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

[dir="rtl"] .article-meta-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .font-monospace {
    letter-spacing: 0;
}

/* Utilitaire pour retourner les flèches en Arabe */
[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
    display: inline-block;
}

/* ==========================================================================
   CONTENU ÉDITEUR (CKEDITOR 5) - CORRECTIF DARK MODE
   ========================================================================== */

.article-content, .ck-content {
    color: var(--text-main) !important; 
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-content p, .article-content li, 
.ck-content p, .ck-content li {
    color: var(--text-main) !important;
}

.article-content h2, .article-content h3, .article-content h4,
.ck-content h2, .ck-content h3, .ck-content h4 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: none;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-content a, .ck-content a {
    color: var(--neon-blue) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-content span, .ck-content span {
    background-color: transparent !important;
    color: inherit !important;
}

/* Tableaux */
.ck-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ck-content th {
    background-color: rgba(14, 165, 233, 0.15);
    color: var(--neon-blue) !important;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ck-content td {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.ck-content blockquote {
    border-left: 4px solid var(--neon-blue);
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    font-style: italic;
    color: var(--text-muted) !important;
    margin: 1.5rem 0;
}

[dir="rtl"] .ck-content blockquote {
    border-left: none;
    border-right: 4px solid var(--neon-blue);
}

/* ==========================================================================
   OPTIMISATION MOBILE (RESPONSIVE) - (INDISPENSABLE)
   ========================================================================== */

@media (max-width: 768px) {
    /* Ajustement des gros titres */
    h1.display-4 {
        font-size: 2rem !important;
        font-weight: 800;
    }

    /* Le Hero passe en mode vertical (Image haut / Texte bas) */
    .hero-image-bg {
        position: relative !important;
        height: 250px !important;
    }
    
    .hero-overlay-gradient {
        background: linear-gradient(0deg, var(--bg-card) 0%, rgba(0,0,0,0) 100%);
    }

    /* Tableaux Scrollables (Vital pour la Data) */
    .ck-content table, .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Conteneurs Plotly (Cartes/Graphes) */
    .plotly-graph-div, .js-plotly-plot {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Cache la barre d'outils Plotly sur mobile */
    .modebar {
        display: none !important;
    }
    
    /* Marge interne plus petite sur mobile */
    .card-body {
        padding: 1.5rem !important;
    }
}

/* ==========================================================================
   EFFETS SPÉCIAUX & FOOTER
   ========================================================================== */
#scroll-progress {
    background: linear-gradient(to right, var(--neon-blue), var(--neon-cyan));
    box-shadow: 0 0 10px var(--neon-glow);
}

.typing-cursor::after {
    content: '_';
    animation: blink 1s steps(2, start) infinite;
    color: var(--neon-cyan);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.animate-pulse {
    animation: pulse-red 2s infinite;
}

footer {
    background-color: #020617 !important;
    margin-top: auto;
}