/* =====================================================
   DRAWER SYSTEM â€” Styles communs Ã  tous les drawers
   ===================================================== */

/* Bouton dÃ©clencheur */

.projets-drawer-trigger,
.cpts-drawer-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    background: white!important;
    color: #4d74b5!important;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gestion-equipe:hover,
.projets-drawer-trigger:hover,
.cpts-drawer-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-gestion-equipe img,
.projets-drawer-trigger img {
    width: 24px;
    height: 24px;
    
}

/* Overlay */
.cpts-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cpts-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer principal */
.cpts-drawer {
    position: fixed;
    top: 0;
    right: -600px;
    width: 580px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 100001;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
}

.cpts-drawer.open {
    right: 0;
}

/* Header du drawer */
.cpts-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.cpts-drawer-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1d2327;
}

.cpts-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.2s;
}

.cpts-drawer-close:hover {
    color: #d63638;
}

/* Onglets */
.cpts-drawer-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
    overflow-x: auto;
}

.cpts-drawer-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.cpts-drawer-tab:hover {
    color: #4d74b5;
}

.cpts-drawer-tab.active {
    color: #4d74b5;
    border-bottom-color: #4d74b5;
    font-weight: 600;
}

/* Contenu du drawer */
.cpts-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cpts-drawer-panel {
    display: none;
}

.cpts-drawer-panel.active {
    display: block;
}

/* Liste des items dans le drawer */
.cpts-drawer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cpts-drawer-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}

.cpts-drawer-list-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cpts-drawer-list-item-title {
    font-weight: 500;
    color: #1d2327;
    flex: 1;
}

.cpts-drawer-list-item-actions {
    display: flex;
    gap: 8px;
}

.cpts-drawer-list-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.cpts-drawer-list-item-actions button:hover {
    background: #f0f0f0;
}

.cpts-drawer-list-item-actions .btn-delete:hover {
    background: #fee;
    color: #d63638;
}

/* Drawer de second niveau (iframe) */
.cpts-drawer-second {
    position: fixed;
    top: 0;
    right: -650px;
    width: 620px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 100002;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.25);
}

.cpts-drawer-second.open {
    right: 0;
}

.cpts-drawer-second iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* Boutons d'action */
.cpts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.cpts-btn-primary {
    background: #4d74b5;
    color: white;
}

.cpts-btn-primary:hover {
    background: #3d5a8a;
}

.cpts-btn-danger {
    background: #d63638;
    color: white;
}

.cpts-btn-danger:hover {
    background: #b32d2e;
}

.cpts-btn-success {
    background: #00a09a;
    color: white;
}

.cpts-btn-success:hover {
    background: #008f8a;
}

/* Toast / notifications */
.cpts-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1d2327;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 100010;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
}

.cpts-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cpts-toast.success {
    background: #00a09a;
}

.cpts-toast.error {
    background: #d63638;
}

/* Spinner de chargement */
.cpts-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f0f0f0;
    border-top-color: #4d74b5;
    border-radius: 50%;
    animation: cpts-spin 0.8s linear infinite;
}

@keyframes cpts-spin {
    to { transform: rotate(360deg); }
}



/* =====================================================
   RESPONSIVE DRAWER
   ===================================================== */
@media (max-width: 640px) {
    .cpts-drawer,
    .cpts-drawer-second {
        width: 100vw;
        max-width: 100vw;
    }
}

