﻿/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .toast-container.show {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: white;
    border-left: 4px solid #3b82f6;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.toast-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .toast-close:hover {
        background: rgba(0, 0, 0, 0.1);
        color: #374151;
    }

/* Toast variants */
.toast.info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

    .toast.info::before {
        content: "ℹ️";
        font-size: 20px;
        margin-right: 8px;
    }

.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

    .toast.success::before {
        content: "✅";
        font-size: 20px;
        margin-right: 8px;
    }

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

    .toast.error::before {
        content: "❌";
        font-size: 20px;
        margin-right: 8px;
    }

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

    .toast.warning::before {
        content: "⚠️";
        font-size: 20px;
        margin-right: 8px;
    }

/* Loading container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-container p {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        padding: 14px 16px;
    }

    .toast-content {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .toast-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* Animation de sortie */
.toast-container.hide {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}
/* Bouton "Ajouter action rapide" dans la toolbar */
.toolbar-action-btn.add-action {
    background: #10b981;
}

    .toolbar-action-btn.add-action:hover {
        background: #059669;
    }

/* Quick actions menu - wrapper pour chaque item */
.quick-action-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

    .quick-action-item-wrapper:hover {
        background: #f9fafb;
    }

    .quick-action-item-wrapper:last-child {
        border-bottom: none;
    }

    /* Quick action item (partie cliquable) */
    .quick-action-item-wrapper .quick-action-item {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        padding: 0;
        border-bottom: none;
    }

/* Contrôles pour éditer/supprimer une action rapide */
.quick-action-controls {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.quick-action-item-wrapper:hover .quick-action-controls {
    opacity: 1;
}

.quick-action-edit,
.quick-action-delete {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quick-action-edit {
    background: #eff6ff;
    color: #3b82f6;
}

    .quick-action-edit:hover {
        background: #dbeafe;
    }

.quick-action-delete {
    background: #fef2f2;
    color: #ef4444;
}

    .quick-action-delete:hover {
        background: #fee2e2;
    }

    .quick-action-edit svg,
    .quick-action-delete svg {
        stroke: currentColor;
    }

/* Bouton "Ajouter une action" en bas du menu */
.quick-action-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: #f9fafb;
    border-top: 2px dashed #e5e7eb;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

    .quick-action-add:hover {
        background: #eff6ff;
        color: #2563eb;
    }

    .quick-action-add svg {
        stroke: currentColor;
    }

/* Responsive */
@media (max-width: 768px) {
    .quick-action-controls {
        opacity: 1;
    }

    .quick-action-edit,
    .quick-action-delete {
        width: 28px;
        height: 28px;
    }
}

/* Container de la modal */
.custom-shortcut-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10001; /* ✅ Au-dessus de l'overlay */
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Header de la modal */
.custom-shortcut-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .custom-shortcut-modal .modal-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
        margin: 0;
        color: white;
        padding-right: 40px;
    }

/* Bouton de fermeture */
.custom-shortcut-modal .modal-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    backdrop-filter: blur(10px);
}

    .custom-shortcut-modal .modal-close:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateY(-50%) scale(1.1);
    }

/* Body de la modal */
.custom-shortcut-modal .modal-body,
.custom-shortcut-modal .modal-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: white;
}

/* Footer de la modal */
.custom-shortcut-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

/* Form groups */
.custom-shortcut-modal .form-group {
    margin-bottom: 20px;
}

    .custom-shortcut-modal .form-group label {
        display: block;
        font-weight: 600;
        color: #374151;
        margin-bottom: 8px;
        font-size: 14px;
    }

.custom-shortcut-modal .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

    .custom-shortcut-modal .form-control:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

/* Action preview */
.action-preview {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.action-preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

    .action-preview-header svg {
        stroke: #0c4a6e;
        flex-shrink: 0;
    }

    .action-preview-header h4 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #0c4a6e;
    }

.action-preview-description {
    color: #0369a1;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.action-preview-detail {
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #0c4a6e;
    margin-top: 8px;
}

    .action-preview-detail strong {
        font-weight: 600;
        color: #075985;
    }

/* Target button info */
.target-button-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde047;
    border-radius: 8px;
    color: #78350f;
    font-size: 14px;
    margin-top: 16px;
}

    .target-button-info svg {
        stroke: #ca8a04;
        flex-shrink: 0;
    }

    .target-button-info strong {
        font-weight: 600;
        color: #92400e;
    }

/* Responsive */
@media (max-width: 768px) {
    .custom-shortcut-modal {
        width: 95%;
        max-width: none;
    }

    .action-preview {
        padding: 16px;
    }

    .action-preview-header h4 {
        font-size: 16px;
    }

    .action-preview-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .custom-shortcut-modal .modal-header {
        padding: 16px 20px;
    }

        .custom-shortcut-modal .modal-header h3 {
            font-size: 1.1rem;
        }

    .action-preview {
        padding: 12px;
    }

    .action-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .target-button-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}