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

:root {
    --neon-green: #00ff41;
    --neon-cyan: #00ffff;
    --neon-red: #ff0040;
    --neon-yellow: #ffff00;
    --dark-bg: #0a0e27;
    --panel-bg: rgba(10, 20, 40, 0.95);
    --terminal-green: #00ff41;
    --text-dim: #4a9c6d;
}

body {
    font-family: 'Courier New', monospace;
    background: var(--dark-bg);
    color: var(--neon-green);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Effet Matrix en arrière-plan */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
}

/* Scanlines effet CRT */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

/* Vignette */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 998;
}

/* Container principal */
.terminal-container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.terminal-header {
    text-align: center;
    margin-bottom: 30px;
    border: 2px solid var(--neon-green);
    padding: 20px;
    background: var(--panel-bg);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.5),
                inset 0 0 30px rgba(0, 255, 65, 0.1);
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 255, 65, 0.5),
                    inset 0 0 30px rgba(0, 255, 65, 0.1);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 255, 65, 0.8),
                    inset 0 0 50px rgba(0, 255, 65, 0.2);
    }
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 10px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--neon-green);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px var(--neon-green);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.timestamp {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.system-load span {
    color: var(--neon-cyan);
    font-weight: bold;
}

/* Effet Glitch sur le titre */
.glitch {
    font-size: 3.5rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    letter-spacing: 8px;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        text-shadow: 0 0 10px var(--neon-green),
                     0 0 20px var(--neon-green),
                     0 0 30px var(--neon-green);
    }
    91%, 93% {
        text-shadow: 3px 0 var(--neon-red),
                     -3px 0 var(--neon-cyan);
        transform: translate(-2px, 0);
    }
    92%, 94% {
        text-shadow: -3px 0 var(--neon-red),
                     3px 0 var(--neon-cyan);
        transform: translate(2px, 0);
    }
}

/* Animation typing */
.typing {
    font-size: 1.2rem;
    color: var(--text-dim);
    overflow: hidden;
    border-right: 2px solid var(--neon-green);
    white-space: nowrap;
    animation: typing 4s steps(60) infinite, blink-caret 0.75s step-end infinite;
    display: inline-block;
}

@keyframes typing {
    0%, 100% { width: 0; }
    20%, 80% { width: 100%; }
}

@keyframes blink-caret {
    50% { border-color: transparent; }
}

/* Grille principale */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Panels */
.news-section,
.tips-panel,
.stats-panel {
    background: var(--panel-bg);
    border: 2px solid var(--neon-green);
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--neon-green);
}

.panel-icon {
    font-size: 1.5rem;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.panel-header h2 {
    font-size: 1.5rem;
    letter-spacing: 3px;
    flex: 1;
}

.blink-text {
    background: var(--neon-red);
    color: #000;
    padding: 5px 15px;
    font-weight: bold;
    animation: blink 1s step-end infinite;
}

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

/* News Feed */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 650px;
    overflow: hidden;
}

.news-card {
    background: rgba(0, 255, 65, 0.05);
    border-left: 4px solid var(--neon-cyan);
    padding: 20px;
    transition: all 0.3s ease;
    animation: slideInFromLeft 0.5s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100px);
    }
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-80px) scale(0.95);
        filter: blur(5px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(5px) scale(1.01);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes slideOutToBottom {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
    40% {
        opacity: 0.6;
        transform: translateY(20px) scale(0.98);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateY(80px) scale(0.9);
        filter: blur(5px);
    }
}

.news-card:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--neon-yellow);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.news-tag {
    display: inline-block;
    background: var(--neon-red);
    color: #000;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.news-tag.breaking { background: var(--neon-red); }
.news-tag.tech { background: var(--neon-cyan); }
.news-tag.warning { background: var(--neon-yellow); }

.news-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.news-content {
    color: var(--text-dim);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tips */
.tips-panel {
    height: 180px;
    display: flex;
    flex-direction: column;
}

.tips-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.tip-card {
    background: rgba(255, 0, 64, 0.1);
    border: 1px solid var(--neon-red);
    padding: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    animation: slideInFromRight 0.5s ease-out;
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 100%;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.tip-card:hover {
    background: rgba(255, 0, 64, 0.2);
    box-shadow: 0 0 15px rgba(255, 0, 64, 0.5);
    transform: translateX(5px);
}

.tip-card code {
    color: var(--neon-yellow);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Stats */
.stats-panel {
    height: 560px;
    display: flex;
    flex-direction: column;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.stat-item {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid var(--neon-cyan);
    padding: 10px;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    animation: countUp 2s ease-out;
    transition: all 0.3s ease;
}

.stat-value.danger {
    color: var(--neon-red) !important;
    text-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red) !important;
    animation: shake 0.5s infinite, pulse 1.5s ease-in-out infinite !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mini chart */
.mini-chart {
    border-top: 2px solid var(--neon-green);
    padding-top: 15px;
    margin-top: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-label {
    font-size: 0.75rem;
    color: var(--neon-yellow);
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 2px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border: 1px solid var(--neon-green);
    position: relative;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--neon-cyan), rgba(0, 255, 255, 0.5));
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: barGrow 0.6s ease-out;
    position: relative;
    border-top: 2px solid var(--neon-cyan);
    transition: all 0.3s ease;
}

.chart-bar.critical {
    background: linear-gradient(to top, var(--neon-red), rgba(255, 0, 64, 0.5));
    box-shadow: 0 0 12px var(--neon-red);
    animation: barGrow 0.6s ease-out, pulseSoft 2s ease-in-out infinite;
    border-top: 2px solid var(--neon-red);
}

@keyframes barGrow {
    from {
        height: 0;
        opacity: 0;
        transform: scaleY(0);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes pulseSoft {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 12px var(--neon-red);
    }
    50% {
        opacity: 0.75;
        box-shadow: 0 0 22px var(--neon-red);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0) scaleX(1);
    }
    to {
        opacity: 0;
        transform: translateX(-30px) scaleX(0.5);
    }
}

/* Footer marquee */
.terminal-footer {
    border: 2px solid var(--neon-green);
    background: var(--panel-bg);
    padding: 15px;
    overflow: hidden;
    position: relative;
}

.marquee {
    white-space: nowrap;
    overflow: hidden;
    font-size: 1.1rem;
    color: var(--neon-yellow);
    display: flex;
    width: 100%;
}

.marquee span {
    display: inline-block;
    padding-right: 100%;
    animation: marquee-infinite 480s linear infinite;
}

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

/* Responsive */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .glitch {
        font-size: 2.5rem;
    }

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

/* Animation d'apparition progressive au chargement */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.terminal-container {
    animation: fadeIn 1s ease-out;
}

/* Effet de glow sur hover */
.news-card, .tip-card, .stat-item {
    cursor: default;
}
