/* assets/css/style.css */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

.blog-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.blog-layout .main-content {
    grid-column: 1;
}

.blog-layout .sidebar {
    grid-column: 2;
}

/* responsive */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-layout .sidebar {
        grid-column: 1;
    }
}


/* Header */
header {
    background: var(--dark);
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo h1 {
    margin: 0;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary);
}

/* Search */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 250px;
}

/* Articles */
/*
.article-preview {
    background: white;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}
*/
.article-preview {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
			position: static;   /* annule un éventuel position:absolute */
			display: block;     /* un article par ligne */
			margin-bottom: 2rem;
			overflow: visible;  /* au cas où */
        }

.article-preview:hover {
    transform: translateY(-2px);
}

.article-meta {
    display: flex;
    gap: 15px;
    color: var(--secondary);
    font-size: 0.9em;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.article-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    text-decoration: none;
}

.tag:hover {
    background: var(--primary-dark);
}

/* Sidebar */
.sidebar-widget {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sidebar-widget h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    color: var(--dark);
    text-decoration: none;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.category-list a:hover {
    background: var(--light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 16px;
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
}

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

.btn-success {
    background: var(--success);
}

/* Admin */
.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow);
}

.articles-table th,
.articles-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.articles-table th {
    background: var(--light);
    font-weight: 600;
}

/* Comments */
.comments-section {
    margin-top: 40px;
}

.comment {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--secondary);
}

.comment-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* WYSIWYG Editor */
.editor-toolbar {
    background: var(--light);
    padding: 10px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 3px;
    cursor: pointer;
}

.editor-content {
    min-height: 300px;
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    padding: 15px;
}

/* Uploads */
.upload-preview {
    max-width: 200px;
    margin: 10px 0;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.image-item {
    position: relative;
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

/* Styles spécifiques pour categories.php */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.admin-nav .btn.active {
    background: var(--primary-dark);
}

.admin-content {
    display: grid;
    gap: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instruction {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* --- Admin catégories --- */

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

.actions {
    white-space: nowrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instruction {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.instruction h3 {
    margin-top: 0;
    color: var(--primary);
}

.text-muted {
    color: #888;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
    margin-right: 5px;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        grid-column: 1;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .search-form input {
        width: 100%;
    }
}

