/* Styles généraux pour les menus */
.cms-menu {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cms-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cms-menu li {
    position: relative;
}

.cms-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.cms-menu a:hover {
    background-color: #f5f5f5;
    text-decoration: none;
}

.cms-menu a:last-child {
    border-bottom: none;
}

/* Menu horizontal */
.cms-menu.horizontal {
    display: flex;
    border: none;
    box-shadow: none;
}

.cms-menu.horizontal ul {
    display: flex;
    width: 100%;
}

.cms-menu.horizontal li {
    flex: 1;
}

.cms-menu.horizontal a {
    border-bottom: none;
    border-right: 1px solid #ddd;
    text-align: center;
}

.cms-menu.horizontal a:last-child {
    border-right: none;
}

/* Menu avec sous-menus (dropdown) */
.cms-menu .has-submenu > a::after {
    content: '▼';
    float: right;
    font-size: 12px;
    color: #999;
}

.cms-menu .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.cms-menu .has-submenu:hover .submenu {
    display: block;
}

.cms-menu .submenu a {
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
}

.cms-menu .submenu a:hover {
    background-color: #f8f9fa;
}

/* Menu vertical avec indentation pour les sous-menus */
.cms-menu.vertical .submenu {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 20px;
    width: 100%;
}

/* =====================================================
   Tableau liste des menus — les largeurs sont gérées via col_width dans fct.js
   ===================================================== */
/* Tronquer le texte long dans la colonne Nom */
#listeMenu td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Styles Administration Menus */
.menu-header-actions {
    margin-bottom: 10px;
}

.menu-label {
    margin-right: 3px;
}

.menu-checkbox {
    margin-top: 25px;
}

.sort-handle {
    cursor: move;
    margin-left: 5px;
}

.cms-menu.vertical .submenu a {
    padding-left: 32px;
    background-color: #f8f9fa;
}

.cms-menu.vertical .submenu a:hover {
    background-color: #e9ecef;
}

/* Styles pour les icônes */
.cms-menu .menu-icon {
    margin-right: 8px;
    width: 16px;
    display: inline-block;
    text-align: center;
}

/* Menu responsive */
@media (max-width: 768px) {
    .cms-menu.horizontal {
        flex-direction: column;
    }
    
    .cms-menu.horizontal ul {
        flex-direction: column;
    }
    
    .cms-menu.horizontal li {
        flex: none;
    }
    
    .cms-menu.horizontal a {
        border-right: none;
        border-bottom: 1px solid #ddd;
        text-align: left;
    }
    
    .cms-menu .submenu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
    }
    
    .cms-menu .has-submenu.active .submenu {
        display: block;
    }
}

/* Styles pour l'administration des menus */

.menu-admin-actions {
    white-space: nowrap;
}

.menu-admin-actions a {
    margin-right: 10px;
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
}

.menu-admin-actions .btn-edit {
    background-color: #007bff;
    color: white;
}

.menu-admin-actions .btn-delete {
    background-color: #dc3545;
    color: white;
}

.menu-admin-actions .btn-view {
    background-color: #28a745;
    color: white;
}

/* Formulaire de menu */
.menu-form-group {
    margin-bottom: 20px;
}

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

.menu-form-group input,
.menu-form-group select,
.menu-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.menu-form-group textarea {
    height: 100px;
    resize: vertical;
}

.menu-form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.menu-form-actions button {
    margin-right: 10px;
}

/* Indicateur de statut */
.menu-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.menu-status.published {
    background-color: #d4edda;
    color: #155724;
}

.menu-status.draft {
    background-color: #fff3cd;
    color: #856404;
}

/* Hiérarchie des items de menu */
.menu-hierarchy {
    padding-left: 0;
}

.menu-hierarchy .menu-item {
    list-style: none;
    margin: 5px 0;
    padding: 8px;
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 0 4px 4px 0;
}

.menu-hierarchy .menu-item.level-1 {
    margin-left: 20px;
    border-left-color: #28a745;
}

.menu-hierarchy .menu-item.level-2 {
    margin-left: 40px;
    border-left-color: #ffc107;
}

.menu-hierarchy .menu-item.level-3 {
    margin-left: 60px;
    border-left-color: #dc3545;
}