/* ===== CANVAS MODAL - ESTILOS COMPARTIDOS (Fluent) ===== */

/* Overlay que cubre toda la pantalla */
.canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: canvasFadeIn 0.2s ease-in-out;
}

/* Contenedor del canvas - Fluent Card glassmorphism */
.canvas-container {
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 6.4px 14.4px rgba(0, 0, 0, 0.132),
                0 1.2px 3.6px rgba(0, 0, 0, 0.108);
    min-width: 800px;
    max-width: 1200px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: canvasSlideUp 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Variantes de tamaño */
.canvas-container.canvas-sm {
    min-width: 360px;
    max-width: 480px;
}

.canvas-container.canvas-md {
    min-width: 560px;
    max-width: 720px;
}

.canvas-container.canvas-lg {
    min-width: 800px;
    max-width: 1200px;
}

/* Header del canvas */
.canvas-header {
    padding: 20px 32px;
    border-bottom: 1px solid rgba(237, 235, 233, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border-radius: 1rem 1rem 0 0;
}

.canvas-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #323130;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.canvas-header h5 i {
    font-size: 1.5rem;
    color: #605e5c;
}

.btn-close-canvas {
    background: transparent;
    border: none;
    color: #605e5c;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-close-canvas:hover {
    background-color: #f3f2f1;
    color: #323130;
}

/* Body del canvas */
.canvas-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    background: transparent;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.canvas-body::-webkit-scrollbar {
    width: 8px;
}

.canvas-body::-webkit-scrollbar-track {
    background: #f3f2f1;
}

.canvas-body::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 4px;
}

.canvas-body::-webkit-scrollbar-thumb:hover {
    background: #a19f9d;
}

/* Footer del canvas */
.canvas-footer {
    padding: 16px 32px;
    border-top: 1px solid rgba(237, 235, 233, 0.6);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: transparent;
    border-radius: 0 0 1rem 1rem;
}

/* Botones del canvas - Estilo Fluent */
.btn-canvas {
    padding: 10px 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.1s ease;
    min-width: 110px;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.btn-canvas i {
    font-size: 0.875rem;
}

.btn-cancel {
    background-color: transparent;
    color: #323130;
    border-color: #8a8886;
}

.btn-cancel:hover {
    background-color: #f3f2f1;
    border-color: #323130;
}

.btn-save {
    background-color: #0078d4;
    color: white;
    border-color: #0078d4;
}

.btn-save:hover:not(:disabled) {
    background-color: #106ebe;
    border-color: #106ebe;
}

.btn-save:disabled {
    background-color: #f3f2f1;
    color: #a19f9d;
    border-color: #edebe9;
    cursor: not-allowed;
}

/* Animaciones */
@keyframes canvasFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes canvasSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .canvas-container {
        min-width: unset;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .canvas-container.canvas-sm,
    .canvas-container.canvas-md,
    .canvas-container.canvas-lg {
        min-width: unset;
        max-width: calc(100vw - 32px);
    }

    .canvas-header,
    .canvas-body,
    .canvas-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}
