/* admin/admin_style.css - Thème Clair (Light Theme) */
:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --accent-purple: #6d28d9;
    --accent-purple-glow: #7c3aed;
    --accent-gold: #d97706;
    --text-light: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(124, 58, 237, 0.2);
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
}

/* Page de connexion (Login) */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #f5f3ff 0%, #e2e8f0 100%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(109, 40, 217, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.login-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-light);
}

.login-card p.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.sidebar-brand {
    padding: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand span {
    color: var(--accent-purple-glow);
}

.sidebar-nav {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--accent-purple);
    background: #f8fafc;
}

.nav-item.active {
    color: var(--accent-purple);
    background: #f3e8ff;
    border-left-color: var(--accent-purple);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Main Content Area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-header {
    padding: 1.2rem 2rem;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* Cards & Containers */
.card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #f3e8ff;
    color: var(--accent-purple-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-info .num {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-light);
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

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

table.admin-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table.admin-table tr:hover {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-new {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-read {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* Form inputs */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-purple-glow);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.4rem;
    border-radius: 8px;
    background: var(--accent-purple);
    color: #ffffff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn-admin:hover {
    background: #5b21b6;
}

.btn-danger {
    background: #ef4444;
}

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

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.media-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
}

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.media-admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.media-admin-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.media-admin-content {
    padding: 1rem;
}

/* Accordion UI & Sticky Save Bar pour la Gestion des Contenus */
.accordion-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 5rem;
}

.accordion-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.25s ease;
}

.accordion-card.open {
    border-color: rgba(109, 40, 217, 0.3);
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.08);
}

.accordion-header {
    padding: 1.2rem 1.5rem;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-title-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accordion-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f3e8ff;
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.accordion-title-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 0.15rem;
}

.accordion-title-box p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.accordion-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-card.open .accordion-arrow {
    transform: rotate(180deg);
    color: var(--accent-purple);
}

.accordion-body {
    padding: 1.5rem;
    display: none;
    border-top: 1px solid var(--border-light);
    background: #ffffff;
}

.accordion-card.open .accordion-body {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Sticky Footer Save Bar */
.sticky-save-bar {
    position: sticky;
    bottom: 1.5rem;
    z-index: 100;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Subnav Vertical Tabs UI pour l'Éditeur de Contenu */
.content-editor-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 5rem;
}

@media (max-width: 900px) {
    .content-editor-layout {
        grid-template-columns: 1fr;
    }
}

.subnav-panel {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 1.5rem;
}

.subnav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.5rem 0.8rem 0.8rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.subnav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    margin-bottom: 0.3rem;
}

.subnav-btn i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-muted);
}

.subnav-btn:hover {
    background: #f8fafc;
    color: var(--accent-purple);
}

.subnav-btn:hover i {
    color: var(--accent-purple);
}

.subnav-btn.active {
    background: #f3e8ff;
    color: var(--accent-purple);
}

.subnav-btn.active i {
    color: var(--accent-purple);
}

.subnav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    background: rgba(109, 40, 217, 0.1);
    color: var(--accent-purple);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

/* Visual FontAwesome Icon Picker Grid */
.fa-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 6px;
}

.icon-tile {
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: #f8fafc;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-tile:hover {
    background: #f3e8ff;
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.icon-tile.selected {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.3);
}

/* Mini HTML Helper Toolbar */
.html-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    padding: 6px 10px;
    border-radius: 8px;
}

.toolbar-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 4px;
}

.btn-tool {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tool:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-tool.btn-glow {
    background: linear-gradient(135deg, #a855f7, #6d28d9);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
}

.btn-tool.btn-glow:hover {
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.4);
}

.btn-tool.btn-purple {
    background: #6d28d9;
    color: #ffffff;
    border: none;
}

.btn-tool.btn-purple:hover {
    background: #5b21b6;
}

.btn-tool.btn-gold:hover {
    background: #b45309;
}

/* Menu Déroulant (Dropdown) Utilisateur Administrateur */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.user-dropdown-btn:hover,
.user-dropdown.open .user-dropdown-btn {
    background: #f8fafc;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.user-dropdown-btn i.user-avatar {
    font-size: 1.15rem;
    color: var(--accent-purple);
}

.user-dropdown-btn i.dropdown-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-dropdown.open i.dropdown-chevron {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(109, 40, 217, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 6px 0;
    display: none;
    z-index: 1000;
}

.user-dropdown.open .user-dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

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

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown-item:hover {
    background: #f3e8ff;
    color: var(--accent-purple);
}

.user-dropdown-item.dropdown-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Modale d'Édition Admin & Boutons d'Ordre */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

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

.admin-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: all 0.25s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.admin-modal-overlay.active .admin-modal {
    transform: translateY(0) scale(1);
}

.admin-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.admin-modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    color: var(--text-light);
    margin: 0;
}

.admin-modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.admin-modal-close:hover {
    color: #ef4444;
    background: #fee2e2;
}

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.media-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.btn-order {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-order:hover {
    background: #e2e8f0;
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.btn-order.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Style Drag & Drop & Toast Notification en Temps Réel */
.media-admin-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.media-admin-card.draggable-card {
    cursor: grab;
    user-select: none;
}

.media-admin-card.draggable-card:active {
    cursor: grabbing;
}

.media-admin-card.dragging {
    opacity: 0.4;
    transform: scale(0.97);
    border: 2px dashed var(--accent-purple);
    box-shadow: 0 10px 25px rgba(109, 40, 217, 0.2);
}

.media-admin-card.drag-over {
    border: 2px solid var(--accent-purple-glow);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25);
}

.drag-handle {
    cursor: grab;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease, color 0.2s ease;
}

.drag-handle:hover {
    background: var(--accent-purple);
    color: #ffffff;
}

.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: #ffffff;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}



/* ==========================================================================
   Responsive Media Queries pour l'Administration
   ========================================================================== */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem 1.5rem;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        white-space: nowrap;
    }

    .sidebar-nav .nav-item {
        padding: 0.55rem 0.9rem;
        font-size: 0.82rem;
        flex-shrink: 0;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-content {
        padding: 1.5rem 1rem;
    }

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

    .subnav-panel {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        white-space: nowrap;
        padding: 0.8rem;
    }

    .subnav-panel .subnav-btn {
        flex-shrink: 0;
        width: auto;
    }

    .sticky-save-bar {
        left: 0;
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

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