/**
 * MMAS — Instructor Shell (header + side menu)
 *
 * Styles partagés entre toutes les pages animateur. Calqué sur parent/shell.css
 * mais avec une teinte différente (gradient violet + accent).
 */

.shell-header, .shell-header *,
.side-menu, .side-menu *,
.side-menu-overlay,
.hamburger-btn, .hamburger-badge,
.shell-logout-btn,
.lang-switcher, .lang-btn {
    box-sizing: border-box;
}

/* ===== HEADER STICKY ===== */
.shell-header {
    background: linear-gradient(135deg, var(--primary, #4338ca) 0%, var(--primary-light, #6366f1) 50%, var(--accent, #8b5cf6) 100%);
    color: white;
    padding: calc(env(safe-area-inset-top, 0) + 0.8rem) 1.2rem 0.8rem;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.shell-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.shell-header .brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    font-weight: 700;
}
.shell-header .brand img {
    height: 32px;
    object-fit: contain;
    background: white;
    padding: 3px;
    border-radius: 6px;
}
.shell-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.shell-page-title {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}
.shell-page-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .shell-header .brand img { display: none; }
    .shell-header .brand span { display: none; }
    .shell-page-title { font-size: 0.95rem; }
}

/* ===== HAMBURGER ===== */
.hamburger-btn {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    font-size: 1.1rem;
    -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover, .hamburger-btn:active { background: rgba(255, 255, 255, 0.25); }
.hamburger-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--danger, #ef4444); color: white;
    border-radius: 999px;
    font-size: 0.7rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid white;
}
.hamburger-badge.hidden { display: none; }

/* ===== LOGOUT BTN ===== */
.shell-logout-btn {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.shell-logout-btn:hover { background: rgba(255, 255, 255, 0.25); }

/* ===== SIDE MENU (slide-in from left) ===== */
.side-menu-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 5000;
}
.side-menu-overlay.is-open { opacity: 1; pointer-events: auto; }

.side-menu {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 78%; max-width: 320px;
    background: white;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 5001;
    display: flex; flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
.side-menu.is-open { transform: translateX(0); }

.side-menu-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
}
.side-menu-close {
    margin-left: auto;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gray-50, #f8fafc);
    border: none; cursor: pointer;
    color: var(--gray-700, #334155);
    display: inline-flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.side-menu-nav {
    flex: 1; overflow-y: auto;
    padding: 12px 8px;
    display: flex; flex-direction: column;
    gap: 2px;
}
.side-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: transparent; border: none; cursor: pointer;
    text-align: left;
    border-radius: 10px;
    color: var(--gray-800, #1e293b);
    font-size: 0.95rem; font-weight: 500;
    position: relative;
    min-height: 48px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.side-menu-item i { width: 22px; text-align: center; color: var(--gray-500, #64748b); font-size: 1.05rem; }
.side-menu-item:hover { background: var(--gray-50, #f8fafc); }
.side-menu-item.active {
    background: #eef2ff;
    color: var(--primary, #4338ca);
    font-weight: 700;
}
.side-menu-item.active i { color: var(--primary, #4338ca); }
.side-menu-item .nav-badge {
    margin-left: auto;
    background: var(--danger, #ef4444);
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.side-menu-divider {
    height: 1px;
    background: var(--gray-100, #f1f5f9);
    margin: 8px 16px;
}
.side-menu-item--danger { color: var(--danger, #ef4444); }
.side-menu-item--danger i { color: var(--danger, #ef4444); }
.side-menu-item--danger:hover { background: #fef2f2; }
