/* ============================================
   STYLES COMPLETS - ÉLECTRO-ACTU
   ============================================ */

/* Variables CSS */
:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary: #eab308;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --bg-color: #f8fafc;
    --card-bg: white;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    --radius: 0.5rem;
    --radius-lg: 1rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar.admin-navbar {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--secondary);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
}

.btn-google {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-google:hover {
    background: var(--gray-50);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    transition: color 0.3s;
}

.btn-read-more:hover {
    color: var(--primary-dark);
}

/* ============================================
   USER MENU
   ============================================ */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.avatar-large {
    width: 3rem;
    height: 3rem;
}

.user-name {
    font-weight: 600;
}

.dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.dropdown-name {
    font-weight: 700;
    font-size: 1rem;
}

.dropdown-email {
    font-size: 0.75rem;
    opacity: 0.9;
}

.dropdown hr {
    border: none;
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.3s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item i {
    width: 1.25rem;
    color: var(--gray-600);
}

.dropdown-item.logout {
    color: var(--danger);
}

.dropdown-item.logout:hover {
    background: #fee2e2;
}

.dropdown-item.logout i {
    color: var(--danger);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

/* Search Bar */
.search-bar {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.search-bar i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.25rem;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    border: none;
    border-radius: 3rem;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--gray-700);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.sort-bar label {
    font-weight: 600;
    color: var(--gray-700);
}

.sort-bar select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
}

/* ============================================
   ARTICLES GRID
   ============================================ */
.articles-grid {
    display: grid;
    gap: 2rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.badge-red {
    background: #fee2e2;
    color: #dc2626;
}

.badge-green {
    background: #d1fae5;
    color: #059669;
}

.badge-yellow {
    background: #fef3c7;
    color: #f59e0b;
}

.badge-orange {
    background: #fed7aa;
    color: #c2410c;
}

.badge-purple {
    background: #e9d5ff;
    color: #7c3aed;
}

.article-date {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.article-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
    line-height: 1.3;
}

.article-summary {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.article-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.article-stats span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.widget h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-left: 4px solid var(--secondary);
    padding-left: 0.75rem;
}

.widget-newsletter {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
}

.widget-newsletter h3 {
    border: none;
    padding: 0;
}

.widget-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.widget-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-style: italic;
}

/* Popular Articles */
.popular-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: background 0.3s;
    cursor: pointer;
}

.popular-item:hover {
    background: var(--gray-50);
}

.popular-rank {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.popular-content {
    flex: 1;
    min-width: 0;
}

.popular-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popular-title:hover {
    color: var(--primary);
}

.popular-views {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--gray-400);
    padding: 0 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 3rem 1rem;
    margin-top: 4rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 1.5rem;
}

.social-links a {
    color: white;
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: var(--secondary);
    transform: translateY(-3px);
}

/* ============================================
   AUTH PAGE
   ============================================ */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-tabs {
    display: flex;
    background: var(--gray-50);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.auth-tab:hover {
    background: var(--gray-100);
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

.auth-form {
    display: none;
    padding: 2rem;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray-600);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
}

.input-icon:hover {
    color: var(--primary);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox input {
    cursor: pointer;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray-500);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-300);
}

.divider::before {
    margin-right: 1rem;
}

.divider::after {
    margin-left: 1rem;
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.password-strength .weak {
    color: var(--danger);
}

.password-strength .medium {
    color: var(--warning);
}

.password-strength .good {
    color: var(--success);
}

.password-strength .strong {
    color: var(--success);
    font-weight: 700;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 2001;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--gray-100);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.modal-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.modal-body h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.text-danger {
    color: var(--danger);
    font-weight: 600;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--gray-50);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--gray-600);
    font-size: 1.25rem;
}

.modal-close:hover {
    background: var(--gray-100);
}

/* ============================================
   NOTIFICATION
   ============================================ */
.notification {
    position: fixed;
    top: 5rem;
    right: -400px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 20rem;
    transition: right 0.3s ease-out;
    border-left: 4px solid var(--primary);
}

.notification.show {
    right: 1rem;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.success i {
    color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.error i {
    color: var(--danger);
}

.notification i {
    font-size: 1.25rem;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 3rem 0;
}

.loading i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.loading-small {
    text-align: center;
    padding: 1rem;
}

.loading-small i {
    font-size: 1.5rem;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-text {
    color: var(--gray-500);
    font-style: italic;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

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

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn-text {
        display: none;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .notification {
        left: 1rem;
        right: -400px;
        max-width: calc(100% - 2rem);
    }

    .notification.show {
        right: auto;
        left: 1rem;
    }
}

.nav-logo {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}