/* ============================================
   GENERAL STYLES
   ============================================ */
.ql-container {
    min-height: 120px;
}

.ql-editor {
    min-height: 100px;
}

.task-comment img {
    max-width: 100%;
    height: auto;
}

/* Transitions douces */
* {
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
}

/* Focus visible pour accessibilité */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    background: #1f2937;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   EDITOR TOOLBAR STYLES
   ============================================ */
.editor-toolbar {
    background: linear-gradient(180deg, #262626 0%, #1a1a1a 100%);
}

.editor-toolbar-secondary {
    background: #1f1f1f;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toolbar-btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.toolbar-btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.toolbar-btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.toolbar-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.toolbar-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    color: rgba(255, 255, 255, 0.6);
}

.toolbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.toolbar-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 0.5rem;
    letter-spacing: 0.05em;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
}

.toolbar-item {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.toolbar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.toolbar-item.active {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.toolbar-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.toolbar-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.toolbar-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.toolbar-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.color-input-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.color-input-wrapper:hover {
    background: rgba(255, 255, 255, 0.2);
}

.color-input-wrapper i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    pointer-events: none;
}

.color-input-wrapper input[type="color"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ============================================
   SLIDE PANEL STYLES
   ============================================ */
.slides-panel {
    background: linear-gradient(180deg, #262626 0%, #1a1a1a 100%);
}

.slide-thumb {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.slide-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}

.slide-thumb.active {
    background: rgba(59, 130, 246, 0.2);
    outline: 2px solid #3b82f6;
}

.slide-thumb-inner {
    aspect-ratio: 16/9;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slide-thumb-num {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.65rem;
    margin-top: 0.25rem;
}

.slide-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.slide-action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
}

.slide-action-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slide-action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.slide-action-btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    color: rgba(239, 68, 68, 0.8);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.slide-action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ============================================
   SLIDE CANVAS
   ============================================ */
.slide-canvas {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: inherit;
}

/* ============================================
   SLIDE ELEMENTS
   ============================================ */
.slide-element {
    position: absolute;
    box-sizing: border-box;
}

.slide-element.selected {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.slide-element.multi-selected {
    outline: 2px dashed #8b5cf6;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

/* ============================================
   SELECTION BOX
   ============================================ */
.selection-box {
    position: absolute;
    border: 2px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    pointer-events: none;
    z-index: 9999;
    display: none;
    border-radius: 2px;
}

.slide-element .element-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Move handle for all elements */
.slide-element .move-handle {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 16px;
    background: #3b82f6;
    border-radius: 4px 4px 0 0;
    cursor: move;
    display: none;
    align-items: center;
    justify-content: center;
}

.slide-element .move-handle i {
    color: white;
    font-size: 10px;
}

.slide-element.selected .move-handle {
    display: flex;
}

.slide-element .text-content {
    outline: none;
    cursor: text;
    padding: 8px;
}

.slide-element .image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
    border: 2px dashed #d1d5db;
    cursor: pointer;
}

.slide-element .image-placeholder i {
    font-size: 24px;
}

.slide-element .task-element {
    padding: 12px;
    border-radius: 8px;
    overflow: hidden;
    cursor: move;
}

.slide-element .task-status {
    font-size: 10px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 600;
}

.slide-element .task-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.slide-element .task-desc {
    font-size: 12px;
    color: #4b5563;
    margin-top: 8px;
}

.slide-element .shape-element {
    width: 100%;
    height: 100%;
    cursor: move;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 2px;
    display: none;
}

.slide-element.selected .resize-handle {
    display: block;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

/* Table */
.slide-element table {
    border-collapse: collapse;
    width: 100%;
    height: 100%;
}

.slide-element td {
    border: 1px solid #d1d5db;
    padding: 6px;
    font-size: 12px;
    vertical-align: top;
}

.slide-element td:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background: #eff6ff;
}

/* ============================================
   TASK PICKER
   ============================================ */
.task-picker-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.task-picker-item:hover {
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 48rem;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease-out;
}

.modal-content-dark {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 32rem;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Form elements */
.form-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    transition: all 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.radio-option input,
.checkbox-option input {
    accent-color: #3b82f6;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #000;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-primary:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
}

.btn-secondary:hover {
    background: #f9fafb;
}

.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #ef4444;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ============================================
   PRINT STYLES
   ============================================ */
.print-only {
    display: none;
}

@media print {
    @page {
        size: landscape;
        margin: 0;
    }

    body>*:not(#printContainer) {
        display: none !important;
    }

    #printContainer {
        display: block !important;
    }

    .print-slide {
        page-break-after: always;
        width: 100vw;
        height: 100vh;
        position: relative;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-slide:last-child {
        page-break-after: avoid;
    }

    .print-slide .slide-element {
        position: absolute;
    }

    .print-slide .resize-handle,
    .print-slide .move-handle {
        display: none !important;
    }
}

/* ============================================
   PRESENTATION MODE
   ============================================ */
#presentation {
    z-index: 9999;
}

#presentationSlide .slide-element {
    cursor: default;
}

#presentationSlide .resize-handle,
#presentationSlide .move-handle {
    display: none !important;
}