/* Interface Administration WizKado */

/* Variables CSS (inherit du style principal) */
:root {
    --color-bg: #1a0b2e;
    --color-bg-light: #2d1b4e;
    --color-accent: #ffd700;
    --color-text: #f0e6fa;
    --color-text-muted: #b3a0cc;
    --color-success: #00ffcc;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --border-glow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Styles de base pour l'interface admin */
.admin-page {
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
}

/* Header admin */
.admin-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.admin-header h1 {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.admin-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Grille admin */
.admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.admin-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.admin-card h3 {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
}

.stat-number.created {
    color: var(--color-success);
}

.stat-number.pending {
    color: #f59e0b;
}

.stat-number.progress {
    color: #8b5cf6;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

/* Barre de progression */
.progress-bar,
.progress-bar-large {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-large {
    height: 12px;
    margin-bottom: 1rem;
}

.progress-fill,
.progress-fill-large {
    background: linear-gradient(90deg, var(--color-accent), var(--color-success));
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill-large {
    border-radius: 6px;
}

.progress-text,
.progress-description {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.progress-description {
    margin: 0;
}

/* Actions */
.actions-grid {
    display: grid;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--color-accent);
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-weight: 600;
    flex: 1;
}

.action-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Articles récents */
.recent-articles {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.article-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-status {
    font-size: 1.2rem;
}

.article-content {
    flex: 1;
}

.article-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--color-text);
}

.article-category {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: rgba(255, 215, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.article-actions .btn-link {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
}

/* Catégories */
.categories-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.category-info {
    flex: 1;
}

.category-name {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.category-stats {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.category-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-progress {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
}

.percentage {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* Informations système */
.system-grid {
    display: grid;
    gap: 1rem;
}

.system-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.system-label {
    color: var(--color-text-muted);
}

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

.no-data {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 2rem;
}

/* =================== Styles spécifiques à la gestion des articles =================== */
.articles-header {
    margin-bottom: 2rem;
}

.status-banner {
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid var(--color-success);
    border-radius: 12px;
    padding: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 1.2rem;
}

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

.status-ip {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Vue d'ensemble des statistiques */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-content .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
}

.stat-content .stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}

/* Section de progression */
.progress-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

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

.progress-header h3 {
    color: var(--color-accent);
}

.progress-percentage {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
}

/* Conteneur des articles */
.articles-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.articles-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

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

.section-header h3 {
    color: var(--color-accent);
}

.btn-filter {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
}

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

.article-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.article-card.created {
    border-color: rgba(0, 255, 204, 0.3);
}

.article-card.pending {
    border-color: rgba(245, 158, 11, 0.3);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

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

.article-number {
    background: rgba(255, 215, 0, 0.2);
    color: var(--color-accent);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.article-status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.article-status-badge.created {
    background: rgba(0, 255, 204, 0.2);
    color: var(--color-success);
}

.article-status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.article-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    line-height: 1.4;
}

.article-meta {
    margin-bottom: 1rem;
}

.article-meta .article-category {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    color: var(--color-accent);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.file-status {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.file-status.success {
    color: var(--color-success);
}

.file-status.error {
    color: #ef4444;
}

.article-description {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

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

.btn-action {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-action.primary {
    background: var(--color-accent);
    color: var(--color-bg);
}

.btn-action.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-action:hover {
    transform: translateY(-1px);
}

/* Statistiques par catégorie */
.categories-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.categories-section h3 {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.categories-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-stat {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
}

.category-stat .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.category-stat .category-header .category-name {
    font-weight: 600;
    color: var(--color-text);
}

.category-stat .category-header .category-count {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.category-stat .category-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 3px;
}

.category-percentage {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
}

.no-articles {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 3rem;
}

/* =================== Page d'accès refusé =================== */
.access-denied-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.access-denied-content {
    max-width: 600px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    backdrop-filter: blur(10px);
}

.access-denied-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.access-denied-title {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

.access-denied-message {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.access-details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.access-details h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--color-text-muted);
}

.detail-value {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--color-text);
}

.access-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.security-notice {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
}

.security-notice h4 {
    color: #ef4444;
    margin-bottom: 0.5rem;
}

.security-notice p {
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* New Admin Components */
.actions-group {
    display: flex;
    gap: 0.5rem;
}

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

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

.form-group-admin textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    resize: vertical;
}

.form-group-admin textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

.log-viewer {
    background: #000;
    color: #00ff00;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 500px;
    white-space: pre-wrap;
    border: 1px solid #333;
}

.activity-item {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.activity-item .date {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.activity-item .meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.activity-item strong {
    color: var(--color-text);
}

.budget-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.budget-item {
    background: rgba(255, 215, 0, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.budget-item .count {
    font-weight: 800;
    margin-left: 5px;
    color: var(--color-accent);
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.alert.success {
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    .access-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .access-denied-content {
        padding: 2rem;
    }
    
    .access-denied-title {
        font-size: 2rem;
    }
}