@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #dc2626; /* Rouge */
    --primary-hover: #b91c1c;
    --bg-page: #ffffff;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent: #ef4444;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(at 0% 0%, rgba(220, 38, 38, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(220, 38, 38, 0.02) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Card Hover Animation */
.table-container, .form-container, .login-card, .dashboard-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.table-container:hover, .form-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

/* Header & Nav */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 45px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-danger {
    background: #fee2e2;
    color: var(--primary);
}

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

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.article-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.article-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

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

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

/* Forms */
.form-container {
    max-width: 1000px;
    margin: 2rem auto;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

textarea {
    height: 200px;
    resize: vertical;
}

/* Show Article */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-full-img {
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.article-body {
    font-size: 1.2rem;
    color: var(--text-main);
    white-space: pre-wrap;
    max-width: 800px;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fff1f2;
}

.table-img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fee2e2;
    color: var(--primary);
    display: inline-block;
}

.table-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}

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

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .dashboard-charts-grid, .dashboard-content-grid {
        grid-template-columns: 1fr !important;
    }
}

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

    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }

    .nav-links a {
        margin-left: 0;
    }
    
    .nav-links .btn {
        margin-left: 0 !important;
        width: 100%;
        text-align: center;
    }

    .header-actions {
        margin-left: 0 !important;
        width: 100%;
        justify-content: center;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

    .table-container {
        overflow-x: auto;
    }

    .form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Responsive forms and filters */
    form[style*="display: flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    form[style*="display: flex"] > div {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .filter-header > div {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

