:root {
    --bg-main: #0B0E14; /* Noir/Sombre */
    --bg-panel: rgba(20, 24, 34, 0.7);
    --bg-card: rgba(30, 35, 48, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-primary: #ff3b3b; /* Rouge */
    --accent-secondary: #7d3cff; /* Violet */
    --accent-tertiary: #3b82f6; /* Bleu */
    --text-main: #FFFFFF; /* Blanc pur */
    --text-muted: #9CA3AF;
    --gradient-glow: linear-gradient(135deg, rgba(255, 59, 59, 0.2) 0%, rgba(125, 60, 255, 0.2) 50%, rgba(59, 130, 246, 0.2) 100%);
    --gradient-accent: linear-gradient(135deg, #ff3b3b 0%, #7d3cff 50%, #3b82f6 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.05), transparent 25%);
}

/* Typography */
h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 1.8rem;
    color: var(--accent-primary);
    -webkit-text-fill-color: initial;
}

.logo-by {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 1px;
    margin-left: 4px;
    text-decoration: none;
    -webkit-text-fill-color: var(--accent-primary);
    transition: opacity 0.3s ease;
    vertical-align: middle;
    text-transform: uppercase;
}

.logo-by:hover {
    opacity: 0.7;
}


.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(6px); /* Petit effet sympa de glissement */
}

.nav-item.active {
    color: #fff;
    background: rgba(255, 59, 59, 0.1);
    border: 1px solid rgba(255, 59, 59, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background: var(--gradient-accent);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.nav-item:hover i {
    transform: scale(1.1);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10B981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Topbar */
.topbar {
    height: 80px;
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 14, 20, 0.5);
    backdrop-filter: blur(10px);
    z-index: 5;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 0.5rem 1.25rem;
    width: 350px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.2);
    transform: scale(1.02); /* Effet d'agrandissement doux */
}

.search-bar i {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.5rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Content Area */
.content-area {
    padding: 2.5rem;
    overflow-y: auto;
    flex-grow: 1;
    scroll-behavior: smooth;
}

.content-area::-webkit-scrollbar {
    width: 8px;
}
.content-area::-webkit-scrollbar-track {
    background: transparent;
}
.content-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 1.5rem;
    display: none; /* Hidden by default */
}

.loader-container.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 59, 59, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-secondary);
    border-right-color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

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

.loader-container p {
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Articles Grid */
.grid-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-glow);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.article-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 59, 59, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(255, 59, 59, 0.15);
}

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

.article-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.source-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-secondary);
    font-weight: 500;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: #fff;
}

.article-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.read-more {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.article-card:hover .read-more {
    gap: 0.75rem;
    color: var(--accent-secondary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* Responsive Design */
.burger-menu {
    display: none;
    font-size: 2rem;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.3s ease;
}

.burger-menu:hover {
    color: var(--accent-primary);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.7);
    backdrop-filter: blur(4px);
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 850px) {
    .burger-menu {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        height: 100vh;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .topbar {
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
        max-width: none;
    }

    .content-area {
        padding: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 500px) {
    .grid-articles {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        height: 70px;
        padding: 0 1rem;
    }
    
    .search-bar {
        padding: 0.4rem 1rem;
    }
}

/* Global Loader Animation */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.global-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-icon {
    font-size: 5rem;
    color: var(--accent-primary);
    animation: cog-spin 3s linear infinite;
}

.loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Outfit', sans-serif;
}

.loader-text span:first-child {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.loader-text .loader-by {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: 5px;
    animation: fade-in-up 1s ease-out forwards;
    opacity: 0;
    transform: translateY(15px);
}

@keyframes cog-spin {
    0% {
        transform: rotate(0deg);
        color: var(--accent-primary);
        text-shadow: 0 0 15px rgba(255, 59, 59, 0.6);
    }
    33% {
        color: var(--accent-secondary);
        text-shadow: 0 0 25px rgba(125, 60, 255, 0.8);
    }
    66% {
        color: var(--accent-tertiary);
        text-shadow: 0 0 25px rgba(59, 130, 246, 0.8);
    }
    100% {
        transform: rotate(360deg);
        color: var(--accent-primary);
        text-shadow: 0 0 15px rgba(255, 59, 59, 0.6);
    }
}

@keyframes fade-in-up {
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
